mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.13] gh-125593: Use colors to highlight error locations in tracebacks from exception group (GH-125681) (#126021)
gh-125593: Use colors to highlight error locations in tracebacks from exception group (GH-125681)
(cherry picked from commit 51b012b2a8
)
Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
This commit is contained in:
parent
e4204e879e
commit
9e37bfae5a
3 changed files with 45 additions and 1 deletions
|
@ -1428,7 +1428,7 @@ class TracebackException:
|
|||
f'+---------------- {title} ----------------\n')
|
||||
_ctx.exception_group_depth += 1
|
||||
if not truncated:
|
||||
yield from exc.exceptions[i].format(chain=chain, _ctx=_ctx)
|
||||
yield from exc.exceptions[i].format(chain=chain, _ctx=_ctx, colorize=colorize)
|
||||
else:
|
||||
remaining = num_excs - self.max_group_width
|
||||
plural = 's' if remaining > 1 else ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue