When debugging Python code at the interactive prompt (REPL), often I\'ll write some code which raises an exception, but I haven\'t wrapped it in a try/exc
try
exc
The sys module provides some functions for post-hoc examining of exceptions: sys.last_type, sys.last_value, and sys.last_traceback.
sys
sys.last_value is the one you're looking for.
sys.last_value