diff options
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 8403173..1878779 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -140,7 +140,7 @@ def _print_exception_bltin(exc, /): def format_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None, \ - chain=True): + chain=True, **kwargs): """Format a stack trace and the exception information. The arguments have the same meaning as the corresponding arguments @@ -149,9 +149,10 @@ def format_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None, \ these lines are concatenated and printed, exactly the same text is printed as does print_exception(). """ + colorize = kwargs.get("colorize", False) value, tb = _parse_value_tb(exc, value, tb) te = TracebackException(type(value), value, tb, limit=limit, compact=True) - return list(te.format(chain=chain)) + return list(te.format(chain=chain, colorize=colorize)) def format_exception_only(exc, /, value=_sentinel, *, show_group=False): |