1
0
forked from VimPlug/jedi

Docstring change, to make non ExprStmt statements possible.

This commit is contained in:
Dave Halter
2015-03-05 01:37:47 +01:00
parent ec7a609e44
commit 5d54922c4b

View File

@@ -133,8 +133,10 @@ def _evaluate_for_statement_string(evaluator, string, module):
p = Parser(load_grammar(), code % indent_block(string))
try:
pseudo_cls = p.module.subscopes[0]
stmt = pseudo_cls.statements[-1]
except IndexError:
# First pick suite, then simple_stmt (-2 for DEDENT) and then the node,
# which is also not the last item, because there's a newline.
stmt = pseudo_cls.children[-1].children[-2].children[-2]
except (AttributeError, IndexError):
return []
# Use the module of the param.