[issue6210] Exception Chaining missing method for suppressing context
Nick Coghlan
report at bugs.python.org
Wed Dec 29 09:46:58 CET 2010
Nick Coghlan <ncoghlan at gmail.com> added the comment:
No, the context must always be included unless explicitly suppressed. The interpreter can't reliably tell the difference between a raise statement in the current exception handler and one buried somewhere inside a nested function call. The whole point is to give developers a hint as to how to trigger the broken error handling code, which only works if the default behaviour is to provide the additional information.
Being able to suppress the context *is* a valid feature request, but one that will now need to wait until Python 3.3. In the meantime, sys.excepthook + the traceback module + PYTHONSTARTUP allows individual users to modify the interactive prompt to exhibit whatever exception display behaviour they like, and applications can do the same thing in their __main__module (likely via a context manager retrieved from a utility module).
----------
keywords: +after moratorium
versions: +Python 3.3 -Python 3.2
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6210>
_______________________________________
More information about the Python-bugs-list
mailing list