gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* implementation in the unstable API (#105072)

This commit is contained in:
Irit Katriel 2023-05-30 15:03:36 +01:00 committed by GitHub
parent bd98b65e97
commit b7aadb4583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 196 additions and 1 deletions

View file

@ -772,6 +772,16 @@ Exception Objects
Set :attr:`~BaseException.args` of exception *ex* to *args*.
.. c:function:: PyObject* PyUnstable_Exc_PrepReraiseStar(PyObject *orig, PyObject *excs)
Implement part of the interpreter's implementation of :keyword:`!except*`.
*orig* is the original exception that was caught, and *excs* is the list of
the exceptions that need to be raised. This list contains the the unhandled
part of *orig*, if any, as well as the exceptions that were raised from the
:keyword:`!except*` clauses (so they have a different traceback from *orig*) and
those that were reraised (and have the same traceback as *orig*).
Return the :exc:`ExceptionGroup` that needs to be reraised in the end, or
``None`` if there is nothing to reraise.
.. _unicodeexceptions: