PyDocs

Nav

Python Runtime Services

last_exc

sys

data · Added in 3.12
This variable is not always defined; it is set to the exception instance when an exception is not handled and the interpreter prints an error message and a stack traceback. Its intended use is to allow an interactive user to import a debugger module and engage in post-mortem debugging without having to re-execute the command that caused the error. (Typical use is import pdb; pdb.pm() to enter the post-mortem debugger; see pdb module for more information.)
0 Examples
No examples for sys/last_exc.
See Also
No see-alsos for sys/last_exc
0 Notes
No notes for last_exc