From ed869accdd1428c9cca452fdbe64b643d5662874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Thu, 25 Feb 2021 17:49:45 +0200 Subject: [PATCH] Added the "compact" keyword argument to TracebackException.__init__() This is a requirement to achieve Python 3.10 compatibility. --- trio/_core/_multierror.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/trio/_core/_multierror.py b/trio/_core/_multierror.py index 13fc3f3d0f..54295e71d5 100644 --- a/trio/_core/_multierror.py +++ b/trio/_core/_multierror.py @@ -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, @@ -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