Skip to content

Commit 9cb0b56

Browse files
committed
133: Avoid mutating node.test.comparators
1 parent 6d25eae commit 9cb0b56

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyt/cfg/stmt_visitor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,10 @@ def visit_While(self, node):
584584
))
585585

586586
if isinstance(test, ast.Compare):
587-
comparators = test.comparators
588-
comparators.append(test.left) # quirk. See https://greentreesnakes.readthedocs.io/en/latest/nodes.html#Compare
587+
# quirk. See https://greentreesnakes.readthedocs.io/en/latest/nodes.html#Compare
588+
self.process_loop_funcs(test.left, while_node)
589589

590-
for comp in comparators:
590+
for comp in test.comparators:
591591
self.process_loop_funcs(comp, while_node)
592592
else: # while foo():
593593
self.process_loop_funcs(test, while_node)

0 commit comments

Comments
 (0)