MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / format_exception

Function format_exception

tools/python-3.11.9-amd64/Lib/traceback.py:128–140  ·  view source on GitHub ↗

Format a stack trace and the exception information. The arguments have the same meaning as the corresponding arguments to print_exception(). The return value is a list of strings, each ending in a newline and some containing internal newlines. When these lines are concatenate

(exc, /, value=_sentinel, tb=_sentinel, limit=None, \
                     chain=True)

Source from the content-addressed store, hash-verified

126
127
128def format_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None, \
129 chain=True):
130 """Format a stack trace and the exception information.
131
132 The arguments have the same meaning as the corresponding arguments
133 to print_exception(). The return value is a list of strings, each
134 ending in a newline and some containing internal newlines. When
135 these lines are concatenated and printed, exactly the same text is
136 printed as does print_exception().
137 """
138 value, tb = _parse_value_tb(exc, value, tb)
139 te = TracebackException(type(value), value, tb, limit=limit, compact=True)
140 return list(te.format(chain=chain))
141
142
143def format_exception_only(exc, /, value=_sentinel):

Callers 4

__init__Method · 0.90
format_excFunction · 0.85

Calls 5

formatMethod · 0.95
_parse_value_tbFunction · 0.85
listFunction · 0.85
TracebackExceptionClass · 0.70
typeClass · 0.50

Tested by

no test coverage detected