Skip to content

Commit

Permalink
Fix missinge lineno attribute for AssignedName ast node
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbisme committed Feb 9, 2021
1 parent 21f39d1 commit b6aa1f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rope/base/pynamesdef.py
Expand Up @@ -24,7 +24,10 @@ def get_object(self):
def get_definition_location(self):
"""Returns a (module, lineno) tuple"""
if self.lineno is None and self.assignments:
self.lineno = self.assignments[0].get_lineno()
try:
self.lineno = self.assignments[0].get_lineno()
except AttributeError:
pass
return (self.module, self.lineno)

def invalidate(self):
Expand Down

0 comments on commit b6aa1f0

Please sign in to comment.