1
0
forked from VimPlug/jedi

Fix an issue with sys.path. Also moved the names closure for isinstance checks away (used for sys.path stuff) and use a get_code check instead, which is more flexible.

This commit is contained in:
Dave Halter
2014-09-25 12:35:53 +02:00
parent c2d645b7c1
commit f4c99259b5
3 changed files with 27 additions and 29 deletions

View File

@@ -1396,6 +1396,21 @@ class Call(StatementElement):
def get_code(self):
return self.name.get_code() + super(Call, self).get_code()
def names(self):
"""
Generate an array of string names. If a call is not just names,
raise an error.
"""
def check(call):
while call is not None:
if not isinstance(call, Call): # Could be an Array.
break
yield unicode(call.name)
call = call.next
return list(check(self))
def __repr__(self):
return "<%s: %s>" % (type(self).__name__, self.name)