Message124845
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). |
|
Date |
User |
Action |
Args |
2010-12-29 08:46:58 | ncoghlan | set | recipients:
+ ncoghlan, rhettinger, pitrou, draghuram, eric.araujo, mrabarnett, steven.daprano, poke, ethan.furman |
2010-12-29 08:46:58 | ncoghlan | set | messageid: <1293612418.9.0.877068183634.issue6210@psf.upfronthosting.co.za> |
2010-12-29 08:46:55 | ncoghlan | link | issue6210 messages |
2010-12-29 08:46:55 | ncoghlan | create | |
|