Commit 79b46211 authored by Stefan Behnel's avatar Stefan Behnel

disable return value saving in finally clauses that only change the GIL status

parent 71f693f8
...@@ -6463,7 +6463,9 @@ class TryFinallyStatNode(StatNode): ...@@ -6463,7 +6463,9 @@ class TryFinallyStatNode(StatNode):
ret_temp = None ret_temp = None
if old_label == return_label and not self.finally_clause.is_terminator: if old_label == return_label and not self.finally_clause.is_terminator:
# store away return value for later reuse # store away return value for later reuse
if self.func_return_type: if (self.func_return_type and
not self.is_try_finally_in_nogil and
not isinstance(self.finally_clause, GILExitNode)):
ret_temp = code.funcstate.allocate_temp( ret_temp = code.funcstate.allocate_temp(
self.func_return_type, manage_ref=False) self.func_return_type, manage_ref=False)
code.putln("%s = %s;" % (ret_temp, Naming.retval_cname)) code.putln("%s = %s;" % (ret_temp, Naming.retval_cname))
......
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