Remove a function that was not really needed.

This commit is contained in:
Dave Halter
2017-05-07 15:59:55 +02:00
parent 84d8279089
commit 6c95f73d77
2 changed files with 3 additions and 7 deletions

View File

@@ -476,7 +476,7 @@ class ModuleContext(use_metaclass(CachedMetaClass, context.TreeContext)):
modules = [] modules = []
for i in self.tree_node.iter_imports(): for i in self.tree_node.iter_imports():
if i.is_star_import(): if i.is_star_import():
name = i.star_import_name() name = i.get_paths()[-1][-1]
new = imports.infer_import(self, name) new = imports.infer_import(self, name)
for module in new: for module in new:
if isinstance(module, ModuleContext): if isinstance(module, ModuleContext):

View File

@@ -742,16 +742,12 @@ class ImportFrom(Import):
else: else:
yield as_name.children[::2] # yields x, y -> ``x as y`` yield as_name.children[::2] # yields x, y -> ``x as y``
def star_import_name(self):
"""
The last name defined in a star import.
"""
return self.get_paths()[-1][-1]
def get_paths(self): def get_paths(self):
""" """
The import paths defined in an import statement. Typically an array The import paths defined in an import statement. Typically an array
like this: ``[<Name: datetime>, <Name: date>]``. like this: ``[<Name: datetime>, <Name: date>]``.
:return list of list of Name:
""" """
dotted = self.get_from_names() dotted = self.get_from_names()