Suppressing Implicit Chained Exceptions (Python 3.0)

andrew cooke andrew at
Thu Jul 2 21:07:20 CEST 2009

David Bolen wrote:
> "andrew cooke" <andrew at> writes:
>> However, when printed via format_exc(), this new exception still has
the old exception attached via the mechanism described at
>> (this is Python 3.0).
> If you're in control of the format_exc() call, I think the new chain
keyword parameter can disable this and restore the old behavior.
> If you're not in control of the traceback display, I'm not sure there's
an easy way to prevent it, given that displaying chained exceptions is
the default mode.

Yeah, that's the impression I got too.

Just in case it wasn't clear, I'd like the chaining not to exist at all in
this case), so that it doesn't appear in format_exc outside my control.


More information about the Python-list mailing list