traceback
This module provides a standard interface to format and print stack
traces of Python programs. It exactly mimics the behavior of the
Python interpreter when it prints a stack trace. This is useful when
you want to print stack traces under program control, e.g. in a
``wrapper'' around the interpreter.
The module uses traceback objects — this is the object type
that is stored in the variables sys.exc_traceback and
sys.last_traceback.
The module defines the following functions: