fix for github issue 7, goto function works now right for 'from import' statements

This commit is contained in:
David Halter
2012-09-02 11:52:49 +02:00
parent 251a638ba6
commit acd6488891
2 changed files with 7 additions and 0 deletions

View File

@@ -276,6 +276,10 @@ def goto(source, line, column, source_path):
for s in scopes:
if isinstance(s, imports.ImportPath):
s = s.follow()[0]
try:
s = evaluate.statement_path[0]
except IndexError:
pass
definitions.append(s)
else:
def remove_unreal_imports(names):

View File

@@ -103,3 +103,6 @@ mod1.a
from import_tree import mod1
#! ['a=1']
mod1.a
#! ['a=1.0']
from import_tree.pkg.mod1 import a