1
0
forked from VimPlug/jedi

Finally make it possible to use auto_import_modules for packages

This means that you can now write 'from gi.repository import Gtk' and Gtk completions work.

It also means that other libraries could be used like that for speed or other reasons.

Fixes #531
This commit is contained in:
Dave Halter
2018-07-03 00:58:24 +02:00
parent 5b7984c4d4
commit f4aad8bbfe
5 changed files with 33 additions and 6 deletions

View File

@@ -150,7 +150,7 @@ def load_module(evaluator, path=None, name=None, sys_path=None):
__import__(dotted_path)
except ImportError:
# If a module is "corrupt" or not really a Python module or whatever.
debug.warning('Module %s not importable in path %s.', dotted_path, path)
print_to_stderr('Module %s not importable in path %s.' % (dotted_path, path))
return None
except Exception:
# Since __import__ pretty much makes code execution possible, just
@@ -262,6 +262,9 @@ class DirectObjectAccess(object):
def py__bases__(self):
return [self._create_access_path(base) for base in self._obj.__bases__]
def py__path__(self):
return self._obj.__path__
@_force_unicode_decorator
def get_repr(self):
builtins = 'builtins', '__builtin__'