diff --git a/jedi/imports.py b/jedi/imports.py index 117bc856..e8bf2659 100644 --- a/jedi/imports.py +++ b/jedi/imports.py @@ -253,6 +253,7 @@ class ImportPath(pr.Base): try: importing = find_module(string) except ImportError: + # TODO insert finally here sys.path = temp raise sys.path = temp @@ -287,6 +288,7 @@ class ImportPath(pr.Base): current_namespace = follow_str(rel_path, '__init__') if current_namespace[1]: rest = self.import_path[i:] + break else: module_not_found()