This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients draghuram, eric.araujo, ethan.furman, mrabarnett, ncoghlan, pitrou, poke, rhettinger, steven.daprano
Date 2010-12-29.08:46:55
SpamBayes Score 1.9777817e-06
Marked as misclassified No
Message-id <1293612418.9.0.877068183634.issue6210@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2010-12-29 08:46:58ncoghlansetrecipients: + ncoghlan, rhettinger, pitrou, draghuram, eric.araujo, mrabarnett, steven.daprano, poke, ethan.furman
2010-12-29 08:46:58ncoghlansetmessageid: <1293612418.9.0.877068183634.issue6210@psf.upfronthosting.co.za>
2010-12-29 08:46:55ncoghlanlinkissue6210 messages
2010-12-29 08:46:55ncoghlancreate