1
0
forked from VimPlug/jedi

Fix stub searching for nested modules

This commit is contained in:
Dave Halter
2018-07-27 10:14:37 +02:00
parent e827559340
commit 4e75a35468
4 changed files with 61 additions and 33 deletions

View File

@@ -78,14 +78,14 @@ class StdlibPlugin(BasePlugin):
return wrapper
def import_module(self, callback):
def wrapper(evaluator, import_names, module_context, sys_path):
def wrapper(evaluator, import_names, parent_module_context, sys_path):
# This is a huge exception, we follow a nested import
# ``os.path``, because it's a very important one in Python
# that is being achieved by messing with ``sys.modules`` in
# ``os``.
if import_names == ('os', 'path'):
return module_context.py__getattribute__('path')
return callback(evaluator, import_names, module_context, sys_path)
return parent_module_context.py__getattribute__('path')
return callback(evaluator, import_names, parent_module_context, sys_path)
return wrapper