Skip to content

Commit 9e875c8

Browse files
Thomas SmithThomas Smith
authored andcommitted
Fixed condition order.
1 parent 0d218df commit 9e875c8

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

st3/sublime_lib/resource_path.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ def from_file_path(cls, file_path):
113113
pass
114114
else:
115115
package_path = cls('Packages', package)
116-
if package_path.suffix != '.sublime-package':
117-
continue
118-
return package_path.with_suffix('').joinpath(*rest)
116+
if package_path.suffix == '.sublime-package':
117+
return package_path.with_suffix('').joinpath(*rest)
119118

120119
raise ValueError("Path {!r} does not correspond to any resource path.".format(file_path))
121120

tests/test_resource_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_from_file_path_default_packages(self):
6262
self.assertEqual(
6363
ResourcePath.from_file_path(
6464
Path(sublime.executable_path()).parent.joinpath(
65-
'Packages',' test_package.sublime-package',' foo.py'
65+
'Packages', 'test_package.sublime-package', 'foo.py'
6666
)
6767
),
6868
ResourcePath("Packages/test_package/foo.py")

0 commit comments

Comments
 (0)