[New-bugs-announce] [issue2833] __exit__ silences the active exception

Dmitry Dvoinikov report at bugs.python.org
Mon May 12 09:06:54 CEST 2008

New submission from Dmitry Dvoinikov <dmitry at targeted.org>:

If a context manager is used within exception handling block, the active
exception is silenced after the context block completes and __exit__ exits.

    raise Exception("foo")
    with SomeContextManager():
    raise # in Py2.5 throws 'foo', in Py3.0 fails with RuntimeError

components: Interpreter Core
messages: 66713
nosy: ddvoinikov
severity: normal
status: open
title: __exit__ silences the active exception
type: behavior
versions: Python 3.0

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list