Fix sys_path propagation for builtins load_module
This commit is contained in:
1 parent
aa40ef3140
commit
6780eba157
4 files changed
+9
-8
No files matched your search
@@ -380,7 +380,7 @@ class Importer(object):
|
||||
elif module_file is not None or module_path.endswith(('.py', '.zip', '.egg')):
|
||||
module = _load_module(self._evaluator, module_path, code, sys_path, parent_module)
|
||||
else:
|
||||
module = compiled.load_module(self._evaluator, path=module_path)
|
||||
module = compiled.load_module(self._evaluator, path=module_path, sys_path=sys_path)
|
||||
|
||||
if module is None:
|
||||
# The file might raise an ImportError e.g. and therefore not be
|
||||
@@ -491,7 +491,7 @@ def _load_module(evaluator, path=None, code=None, sys_path=None, parent_module=N
|
||||
from jedi.evaluate.context import ModuleContext
|
||||
return ModuleContext(evaluator, module_node, path=path)
|
||||
else:
|
||||
return compiled.load_module(evaluator, path)
|
||||
return compiled.load_module(evaluator, path=path, sys_path=sys_path)
|
||||
|
||||
|
||||
def add_module(evaluator, module_name, module):
|
||||
|
||||
Reference in new issue
Block a user