Fix the previous error

This commit is contained in:
Takafumi Arakaki
2013-05-23 01:15:30 +02:00
parent ce92fd946b
commit a4922774c0
2 changed files with 7 additions and 2 deletions

View File

@@ -391,7 +391,9 @@ class Script(object):
defs, search_name = evaluate.goto(stmt)
definitions = follow_inexistent_imports(defs)
if isinstance(user_stmt, pr.Statement):
if user_stmt.get_commands()[0].start_pos > self.pos:
call = user_stmt.get_commands()[0]
if not isinstance(call, (str, unicode)) and \
call.start_pos > self.pos:
# The cursor must be after the start, otherwise the
# statement is just an assignee.
definitions = [user_stmt]