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
As seen below, Python 3.11 ExceptionGroup objects don't show sub-exceptions when displayed; explicitly catching and using traceback.print_exc() is required to see them:
❯ jupyter console
In [1]: exc = ExceptionGroup("derp", [Exception("herp")])
In [2]: raise exc
---------------------------------------------------------------------------
ExceptionGroup Traceback (most recent call last)
Cell In[2], line 1
----> 1 raise exc
ExceptionGroup: derp (1 sub-exception)
In [3]: try:
...: raise exc
...: except:
...: import traceback; traceback.print_exc()
...:
+ Exception Group Traceback (most recent call last):
| File "C:\Users\evanj\AppData\Local\Temp\ipykernel_20028\3102285775.py", line 2, in <module>
| raise exc
| File "C:\Users\evanj\anaconda3\Lib\site-packages\IPython\core\interactiveshell.py", line 3505, in run_code
| exec(code_obj, self.user_global_ns, self.user_ns)
| File "C:\Users\evanj\AppData\Local\Temp\ipykernel_20028\3429297078.py", line 1, in <module>
| raise exc
| ExceptionGroup: derp (1 sub-exception)
+-+---------------- 1 ----------------
| Exception: herp
+------------------------------------
As seen below, Python 3.11
ExceptionGroup
objects don't show sub-exceptions when displayed; explicitly catching and usingtraceback.print_exc()
is required to see them:Versions:
The text was updated successfully, but these errors were encountered: