1
0
forked from VimPlug/jedi

add a setting auto_import_modules to fix autocompletion for modules that use setattr and companions a lot. fixes #151

This commit is contained in:
Dave Halter
2014-06-25 17:14:31 +02:00
parent 01869e4100
commit e5efd6e5c8
2 changed files with 11 additions and 1 deletions

View File

@@ -511,7 +511,9 @@ def remove_star_imports(evaluator, scope, ignored_modules=()):
def _load_module(path=None, source=None, name=None, sys_path=None):
def load(source):
if path is not None and path.endswith('.py'):
dotted_path = path and _reverse_fs_path(path, sys_path)
if path is not None and path.endswith('.py') \
and not dotted_path in settings.auto_import_modules:
if source is None:
with open(path, 'rb') as f:
source = f.read()