import statements completion; little bug noticed in #27

This commit is contained in:
David Halter committed 2012-10-18 00:16:49 +02:00
1 parent 75c4ed30ee
commit fa9772c82e
2 files changed
+6

No files matched your search

+4
View File
@@ -234,6 +234,10 @@ class Script(object):
# do the magic functions first? and then recheck here?
if not isinstance(s, evaluate.Function):
if isinstance(s, imports.ImportPath):
if like == 'import':
l = self.module.get_line(self.pos[0])[:self.pos[1]]
if not l.endswith('import import'):
continue
names = s.get_defined_names(on_import_stmt=True)
else:
names = s.get_defined_names()