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
Add _PyErr_ChainExceptions1, which takes an exception instance, to replace the legacy-API _PyErr_ChainExceptions, which is now deprecated. (Contributed by Mark Shannon in gh-101578.)
Add wrapper for PyErr_Fetch that gets just the exception Py 3.12, or triple (earlier)
Py < 3.12 must call PyErr_NormalizeException
Wrapper around PyErr_Restore
Make everywhere use the wrapper
Something like this - backslash ending each line omitted
#definePYERR_FETCH(name)
PyObject *name ## _type, *name, *name ## _tb;
PyErr_Fetch(&name ## _type, &name, &name ## _tb);
PyErr_NormalizeException(...)
/* Py 3.12 version has just name, and uses PyErr_GetRaisedException */
The text was updated successfully, but these errors were encountered:
rogerbinns
changed the title
Use exception chaining
Update exception handling
Sep 10, 2023
There are a lot of places where existing exceptions have to be dealt with and a new one could be raised, and are handled somewhat arbitrarily.
CHAIN_EXC should be used virtually everywhere since that allows reporting multiple exceptions at the same time.
From Python 3.12:
Something like this - backslash ending each line omitted
The text was updated successfully, but these errors were encountered: