[issue5543] sys.last_type missing

Trundle report at bugs.python.org
Mon Mar 23 22:19:36 CET 2009


Trundle <andysmuell at hammerhartes.de> added the comment:

Is the fix really correct? The documentation clearly states about
`sys.last_type`: "These three variables are not always defined; they are set
when an exception is not handled and the interpreter prints an error
message and a stack traceback." And there is already
`traceback.print_exc()`, which is a shorthand for
"print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback, limit,
file)". So, in my opinion, the previous behaviour was intended behaviour,
and the OP needs to use `traceback.print_exc()`.

----------
nosy: +Trundle

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5543>
_______________________________________


More information about the Python-bugs-list mailing list