forked from VimPlug/jedi
static analysis: Import tests working again.
This commit is contained in:
@@ -216,6 +216,8 @@ def get_module_statements(module):
|
||||
for scope in module.walk():
|
||||
for imp in set(scope.imports):
|
||||
import_names |= set(imp.get_defined_names())
|
||||
if imp.is_nested():
|
||||
import_names |= set(path[-1] for path in imp.paths())
|
||||
stmts |= add_stmts(scope.statements)
|
||||
stmts |= add_stmts(r for r in scope.returns if r is not None)
|
||||
|
||||
|
||||
@@ -128,7 +128,8 @@ class ImportWrapper(pr.Base):
|
||||
for s in scopes))
|
||||
else:
|
||||
print(self._import, scopes, rest)
|
||||
if self._import.type == 'import_from':
|
||||
if self._import.type == 'import_from' \
|
||||
or importer.str_import_path == ('os', 'path'):
|
||||
scopes = importer.follow_rest(scopes[0], rest)
|
||||
else:
|
||||
scopes = []
|
||||
|
||||
Reference in New Issue
Block a user