ID EN
Traceback

format_exception

Python 3.11

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 concatenated and printed, exactly the same text is printed as does print_exception().

Syntax

PYTHON
traceback.format_exception(exc, /, [value, tb, ]limit=None, chain=True)

See Also

print_exception() print_exception() print_exception()