Commit bef06c19 authored by Stefan Behnel's avatar Stefan Behnel

avoid generating dead temp cleanup code after except blocks that return/break/continue at the end

parent f3684727
......@@ -6493,9 +6493,10 @@ class ExceptClauseNode(Node):
code.funcstate.exc_vars = exc_vars
self.body.generate_execution_code(code)
code.funcstate.exc_vars = old_exc_vars
for var in exc_vars:
code.put_decref_clear(var, py_object_type)
code.put_goto(end_label)
if not self.body.is_terminator:
for var in exc_vars:
code.put_decref_clear(var, py_object_type)
code.put_goto(end_label)
for new_label, old_label in [(code.break_label, old_break_label),
(code.continue_label, old_continue_label)]:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment