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

Function print_exception

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

Print exception up to 'limit' stack trace entries from 'tb' to 'file'. This differs from print_tb() in the following ways: (1) if traceback is not None, it prints a header "Traceback (most recent call last):"; (2) it prints the exception type and value after the stack trace; (3

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

Source from the content-addressed store, hash-verified

109
110
111def print_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None, \
112 file=None, chain=True):
113 """Print exception up to 'limit' stack trace entries from 'tb' to 'file'.
114
115 This differs from print_tb() in the following ways: (1) if
116 traceback is not None, it prints a header "Traceback (most recent
117 call last):"; (2) it prints the exception type and value after the
118 stack trace; (3) if type is SyntaxError and value has the
119 appropriate format, it prints the line where the syntax error
120 occurred with a caret on the next line indicating the approximate
121 position of the error.
122 """
123 value, tb = _parse_value_tb(exc, value, tb)
124 te = TracebackException(type(value), value, tb, limit=limit, compact=True)
125 te.print(file=file, chain=chain)
126
127
128def format_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None, \

Callers 3

log_exceptionMethod · 0.90
print_excFunction · 0.70
print_lastFunction · 0.70

Calls 4

printMethod · 0.95
_parse_value_tbFunction · 0.85
TracebackExceptionClass · 0.70
typeClass · 0.50

Tested by

no test coverage detected