1
0
forked from VimPlug/jedi

Refactoring: Make Import.get_all_import_names return NameParts.

This commit is contained in:
Dave Halter
2014-09-19 01:40:05 +02:00
parent 83d2af5138
commit b2342c76be
5 changed files with 13 additions and 28 deletions

View File

@@ -323,7 +323,7 @@ class Evaluator(object):
if stmt.alias_name_part == call_path[0]:
return [call_path[0]]
names = stmt.get_all_import_name_parts()
names = stmt.get_all_import_names()
# Filter names that are after our Name
removed_names = len(names) - names.index(call_path[0]) - 1
i = imports.ImportWrapper(self, stmt, kill_count=removed_names)

View File

@@ -226,7 +226,7 @@ def get_module_name_parts(module):
for stmt_or_import in statements_or_imports:
if isinstance(stmt_or_import, pr.Import):
for name in stmt_or_import.get_all_import_names():
name_parts.update(name.names)
name_parts.add(name)
else:
# Running this ensures that all the expression lists are generated
# and the parents are all set. (Important for Lambdas) Howeer, this