mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-18 06:19:39 +08:00
fix a nested import problem with not found imports
This commit is contained in:
@@ -253,6 +253,7 @@ class ImportPath(pr.Base):
|
|||||||
try:
|
try:
|
||||||
importing = find_module(string)
|
importing = find_module(string)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
# TODO insert finally here
|
||||||
sys.path = temp
|
sys.path = temp
|
||||||
raise
|
raise
|
||||||
sys.path = temp
|
sys.path = temp
|
||||||
@@ -287,6 +288,7 @@ class ImportPath(pr.Base):
|
|||||||
current_namespace = follow_str(rel_path, '__init__')
|
current_namespace = follow_str(rel_path, '__init__')
|
||||||
if current_namespace[1]:
|
if current_namespace[1]:
|
||||||
rest = self.import_path[i:]
|
rest = self.import_path[i:]
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
module_not_found()
|
module_not_found()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user