[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:
Miss Islington (bot) 2024-10-27 02:23:00 +01:00 committed by GitHub
parent e4204e879e
commit 9e37bfae5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 1 deletions

View file

@ -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 ''