You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The line number of the instructions emitted for except* (CHECK_EG_MATCH etc) spans the entire except* body, and this shows up in the traceback when except* raises (e.g. when split() fails).
>>> class Bad(ExceptionGroup):
... def split(*args):
... 1/0
...
>>> try: raise Bad("", [ValueError(), TypeError()])
... except* ValueError:
... 1
... 2
... 3
...
+ Exception Group Traceback (most recent call last):
| File "<python-input-1>", line 1, in <module>
| try: raise Bad("", [ValueError(), TypeError()])
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Bad: (2 sub-exceptions)
+-+---------------- 1 ----------------
| ValueError
+---------------- 2 ----------------
| TypeError
+------------------------------------
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<python-input-1>", line 2, in <module>
except* ValueError:
...<2 lines>...
3
File "<python-input-0>", line 3, in split
1/0
~^~
ZeroDivisionError: division by zero
The line number of the instructions emitted for
except*
(CHECK_EG_MATCH
etc) spans the entireexcept*
body, and this shows up in the traceback whenexcept*
raises (e.g. whensplit()
fails).Linked PRs
The text was updated successfully, but these errors were encountered: