Skip to content

Commit

Permalink
Merge pull request #331 from rubendibattista/lineno-attr-error
Browse files Browse the repository at this point in the history
Fix AttributeError lineno
  • Loading branch information
mcepl committed Apr 18, 2021
2 parents 4dba2ff + 0a5271a commit 9407fdc
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 9407fdc

Please sign in to comment.