March 2003
Intermediate to advanced
656 pages
39h 30m
English
print_exc
print_exc(limit=None,file=sys.stderr)
Call print_exc from an exception handler or a
function directly or indirectly called by an exception handler.
print_exc outputs to file-like object
file the traceback information that Python
outputs to stderr for uncaught exceptions. When
limit is not None,
print_exc outputs only
limit traceback nesting levels. For
example, when, in an exception handler, you want to cause a
diagnostic message just as if the exception propagated, but actually
stop the exception from propagating any further (so that your program
keeps running, and no further handlers are involved), call
traceback.print_exc( ).