From aa247b51adfc1dfc97fd4468bc7e137d1995df25 Mon Sep 17 00:00:00 2001 From: 0x45f Date: Fri, 7 Jul 2023 07:51:57 +0000 Subject: [PATCH] Polish remove_global_guarded_variable --- sot/opcode_translator/executor/opcode_executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sot/opcode_translator/executor/opcode_executor.py b/sot/opcode_translator/executor/opcode_executor.py index 466b7c485..c23e8d28d 100644 --- a/sot/opcode_translator/executor/opcode_executor.py +++ b/sot/opcode_translator/executor/opcode_executor.py @@ -1766,7 +1766,6 @@ def FOR_ITER(self, instr): if not isinstance( iterator, (SequenceIterVariable, DictIterVariable) ): - self._graph.remove_global_guarded_variable(iterator) raise BreakGraphError() backup_iter_idx = iterator.idx self._inline_call_for_loop(iterator, instr) @@ -1774,6 +1773,7 @@ def FOR_ITER(self, instr): except BreakGraphError as e: if backup_iter_idx: iterator.idx = backup_iter_idx + self._graph.remove_global_guarded_variable(iterator) self._break_graph_in_for_loop(iterator, instr) return Stop()