traceback.walk_stack()

traceback.walk_stack(f) Walk a stack following f.f_back from the given frame, yielding the frame and line number for each frame. If f is None, the current stack is used. This helper is used with StackSummary.extract(). New in version 3.5.

traceback.TracebackException.__cause__

__cause__ A TracebackException of the original __cause__.

traceback.TracebackException.offset

offset For syntax errors - the offset into the text where the error occurred.

traceback.TracebackException.text

text For syntax errors - the text where the error occurred.

traceback.TracebackException.__suppress_context__

__suppress_context__ The __suppress_context__ value from the original exception.

traceback.TracebackException.__context__

__context__ A TracebackException of the original __context__.

traceback.TracebackException.msg

msg For syntax errors - the compiler error message.

traceback.TracebackException.stack

stack A StackSummary representing the traceback.

traceback.TracebackException.from_exception()

classmethod from_exception(exc, *, limit=None, lookup_lines=True, capture_locals=False) Capture an exception for later rendering. limit, lookup_lines and capture_locals are as for the StackSummary class. Note that when locals are captured, they are also shown in the traceback.

traceback.TracebackException

class traceback.TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False) Capture an exception for later rendering. limit, lookup_lines and capture_locals are as for the StackSummary class. Note that when locals are captured, they are also shown in the traceback. __cause__ A TracebackException of the original __cause__. __context__ A TracebackException of the original __context__. __suppress_context__ The __suppress_context_