forked from VimPlug/jedi
Docstring change, to make non ExprStmt statements possible.
This commit is contained in:
@@ -133,8 +133,10 @@ def _evaluate_for_statement_string(evaluator, string, module):
|
|||||||
p = Parser(load_grammar(), code % indent_block(string))
|
p = Parser(load_grammar(), code % indent_block(string))
|
||||||
try:
|
try:
|
||||||
pseudo_cls = p.module.subscopes[0]
|
pseudo_cls = p.module.subscopes[0]
|
||||||
stmt = pseudo_cls.statements[-1]
|
# First pick suite, then simple_stmt (-2 for DEDENT) and then the node,
|
||||||
except IndexError:
|
# 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 []
|
return []
|
||||||
|
|
||||||
# Use the module of the param.
|
# Use the module of the param.
|
||||||
|
|||||||
Reference in New Issue
Block a user