1
0
forked from VimPlug/jedi

Replace Scope.subscopes with iter_funcdefs and iter_classdefs.

This commit is contained in:
Dave Halter
2017-04-30 01:35:59 +02:00
parent 3e05061f3b
commit b4039872bd
10 changed files with 32 additions and 34 deletions

View File

@@ -134,7 +134,7 @@ def _evaluate_for_statement_string(module_context, string):
# don't need to conform with the current grammar.
module = parse(code.format(indent_block(string)))
try:
funcdef = module.subscopes[0]
funcdef = next(module.iter_funcdefs())
# First pick suite, then simple_stmt and then the node,
# which is also not the last item, because there's a newline.
stmt = funcdef.children[-1].children[-1].children[-2]