diff options
author | Tian Gao <gaogaotiantian@hotmail.com> | 2024-05-04 10:26:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-04 10:26:40 (GMT) |
commit | 00da0afa0d98ce1fae67f7258c7f3db2b81a07e7 (patch) | |
tree | c45fae309e3ba5c4ef905a92fed5358ff496d7d3 /Lib/pdb.py | |
parent | 85af78996117dbe8ad45716633a3d6c39ff7bab2 (diff) | |
download | cpython-00da0afa0d98ce1fae67f7258c7f3db2b81a07e7.zip cpython-00da0afa0d98ce1fae67f7258c7f3db2b81a07e7.tar.gz cpython-00da0afa0d98ce1fae67f7258c7f3db2b81a07e7.tar.bz2 |
gh-113081: Print colorized exception just like built-in traceback in pdb (#113082)
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-x | Lib/pdb.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -84,6 +84,7 @@ import inspect import tokenize import traceback import linecache +import _colorize from contextlib import contextmanager from rlcompleter import Completer @@ -2347,7 +2348,7 @@ def main(): print("The program exited via sys.exit(). Exit status:", end=' ') print(e) except BaseException as e: - traceback.print_exc() + traceback.print_exception(e, colorize=_colorize.can_colorize()) print("Uncaught exception. Entering post mortem debugging") print("Running 'cont' or 'step' will restart the program") pdb.interaction(None, e) |