forked from VimPlug/jedi
The import resolution for namespace packages was wrong
With this change we can now include all parents of the script, which will make relative imports always work. Now the whole meta_path is scanned and not just importlib's PathFinder. Fixes #1183.
This commit is contained in:
@@ -108,12 +108,7 @@ class Project(object):
|
||||
if evaluator.script_path is not None:
|
||||
suffixed += discover_buildout_paths(evaluator, evaluator.script_path)
|
||||
|
||||
traversed = []
|
||||
for parent in traverse_parents(evaluator.script_path):
|
||||
traversed.append(parent)
|
||||
if parent == self._path:
|
||||
# Don't go futher than the project path.
|
||||
break
|
||||
traversed = list(traverse_parents(evaluator.script_path))
|
||||
|
||||
# AFAIK some libraries have imports like `foo.foo.bar`, which
|
||||
# leads to the conclusion to by default prefer longer paths
|
||||
|
||||
Reference in New Issue
Block a user