Commit 01607f46 authored by Stefan Behnel's avatar Stefan Behnel

fix ticket #346

parent 08fb6d10
...@@ -4137,8 +4137,9 @@ class TryExceptStatNode(StatNode): ...@@ -4137,8 +4137,9 @@ class TryExceptStatNode(StatNode):
if error_label_used or not self.has_default_clause: if error_label_used or not self.has_default_clause:
if error_label_used: if error_label_used:
code.put_label(except_error_label) code.put_label(except_error_label)
for var in Naming.exc_save_vars: for var in Naming.exc_save_vars: code.put_xgiveref(var)
code.put_xdecref(var, py_object_type) code.putln("__Pyx_ExceptionReset(%s);" %
', '.join(Naming.exc_save_vars))
code.put_goto(old_error_label) code.put_goto(old_error_label)
for exit_label, old_label in zip( for exit_label, old_label in zip(
......
__doc__ = u"""
>>> def bar():
... try:
... foo()
... except ValueError:
... pass
>>> bar()
>>> print(sys.exc_info())
(None, None, None)
"""
import sys
def foo():
try:
raise TypeError
except TypeError:
raise ValueError
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