[pypy-issue] [issue1755] sys.exc_clear() then re-"raise" raises at the wrong scope

Kevin Modzelewski tracker at bugs.pypy.org
Tue May 6 23:10:50 CEST 2014


New submission from Kevin Modzelewski <kmod at dropbox.com>:

Doesn't seem very important but I thought I'd report it:



import sys

try:
    raise Exception()
except:
    pass
sys.exc_clear()

try:
    raise
except TypeError:
    # Should print this line:
    print "success"



The "raise" statement throws a TypeError as expected; in PyPy, though, this 
TypeError won't trigger the except-clause that follows it, and instead 
immediately propagates to the next frame up.  This only happens if there was a 
previously-thrown exception in this frame that then got cleared with 
sys.exc_clear().

----------
messages: 6849
nosy: kmod, pypy-issue
priority: bug
status: unread
title: sys.exc_clear() then re-"raise" raises at the wrong scope

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1755>
________________________________________


More information about the pypy-issue mailing list