[issue2833] __exit__ silences the active exception

Antoine Pitrou report at bugs.python.org
Sat May 24 16:13:57 CEST 2008


Antoine Pitrou <pitrou at free.fr> added the comment:

Just found another funny example. This one fails also before r62847.

def except_yield():
    try:
        raise Exception("foo")
    except:
        yield 1
        raise
list(except_yield())

In Py3k (with or without r62487), we get "RuntimeError: No active
exception to reraise".
In Python 2.5, we get "TypeError: exceptions must be classes, instances,
or strings (deprecated), not NoneType".

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2833>
__________________________________


More information about the Python-bugs-list mailing list