A prefixed path should not also be suffixed

This commit is contained in:
Dave Halter
2020-02-11 18:34:41 +01:00
parent 0697a39145
commit b4494e588f

View File

@@ -124,7 +124,7 @@ class Project(object):
# 2. Stopping immediately when above self._path # 2. Stopping immediately when above self._path
traversed = [] traversed = []
for parent_path in traverse_parents(inference_state.script_path): for parent_path in traverse_parents(inference_state.script_path):
if not parent_path.startswith(self._path): if parent_path == self._path or not parent_path.startswith(self._path):
break break
if not add_init_paths \ if not add_init_paths \
and os.path.isfile(os.path.join(parent_path, "__init__.py")): and os.path.isfile(os.path.join(parent_path, "__init__.py")):