Skip to content

Commit

Permalink
Added the "compact" keyword argument to TracebackException.__init__()
Browse files Browse the repository at this point in the history
This is a requirement to achieve Python 3.10 compatibility.
  • Loading branch information
agronholm committed Feb 25, 2021
1 parent 875f9f3 commit ed869ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions trio/_core/_multierror.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,17 @@ def traceback_exception_init(
limit=None,
lookup_lines=True,
capture_locals=False,
compact=False,
_seen=None,
):
if _seen is None:
_seen = set()

if sys.version_info >= (3, 10):
kwargs = {"compact": compact}
else:
kwargs = {}

# Capture the original exception and its cause and context as TracebackExceptions
traceback_exception_original_init(
self,
Expand All @@ -396,6 +402,7 @@ def traceback_exception_init(
lookup_lines=lookup_lines,
capture_locals=capture_locals,
_seen=_seen,
**kwargs,
)

# Capture each of the exceptions in the MultiError along with each of their causes and contexts
Expand Down

0 comments on commit ed869ac

Please sign in to comment.