gh-125593: Use colors to highlight error locations in tracebacks from exception group (#125681)

This commit is contained in:
Bogdan Romanyuk 2024-10-27 03:57:10 +03:00 committed by GitHub
parent f6cc7c8bd0
commit 51b012b2a8
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 @@ def format(self, *, chain=True, _ctx=None, **kwargs):
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 ''