Suppressing Implicit Chained Exceptions (Python 3.0)

David Bolen db3l.net at gmail.com
Thu Jul 2 13:58:24 EDT 2009


"andrew cooke" <andrew at acooke.org> writes:

> However, when printed via format_exc(), this new exception still has the
> old exception attached via the mechanism described at
> http://www.python.org/dev/peps/pep-3134/ (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.

-- David



More information about the Python-list mailing list