Remove dedents from the parser tree. No need for them.
This commit is contained in:
1 parent
d748f6fad6
commit
1226962922
7 files changed
+21
-8
No files matched your search
@@ -136,7 +136,7 @@ def _evaluate_for_statement_string(evaluator, string, module):
|
||||
pseudo_cls = p.module.subscopes[0]
|
||||
# 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]
|
||||
stmt = pseudo_cls.children[-1].children[-1].children[-2]
|
||||
except (AttributeError, IndexError):
|
||||
return []
|
||||
|
||||
|
||||
Reference in new issue
Block a user