1
0
forked from VimPlug/jedi

ExprStmt now doesn't contain imports anymore.

This commit is contained in:
Dave Halter
2014-10-17 14:56:12 +02:00
parent d7face17f6
commit 6abafc40fa

View File

@@ -1000,16 +1000,11 @@ class Statement(Simple, DocstringMixin):
self.expression_list() self.expression_list()
def get_defined_names(self): def get_defined_names(self):
first = self.children[0] # children[1] is always a newline. names = []
if isinstance(first, Import): for i in range(0, len(self.children) - 2, 2):
return first.get_defined_names() if self.children[i + 1].value == '=':
elif is_node(first, 'expr_stmt'): names.append(self.children[i])
names = [] return names
for i in range(0, len(first.children) - 2, 2):
if first.children[i + 1].value == '=':
names.append(first.children[i])
return names
return []
"""Get the names for the statement.""" """Get the names for the statement."""