summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-05-30 15:50:23 (GMT)
committerGitHub <noreply@github.com>2023-05-30 15:50:23 (GMT)
commitb45df737d43e809b1c41b9b2056ecb28c3cfb288 (patch)
tree70cc61338652bffc07f89a304d0e2c1c045e7d87 /Doc/c-api
parent7899fac3c5fba3b8258cdd72562230c51164d778 (diff)
downloadcpython-b45df737d43e809b1c41b9b2056ecb28c3cfb288.zip
cpython-b45df737d43e809b1c41b9b2056ecb28c3cfb288.tar.gz
cpython-b45df737d43e809b1c41b9b2056ecb28c3cfb288.tar.bz2
[3.12] gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* implementation in the unstable API (GH-105072) (#105095)
(cherry picked from commit b7aadb4583b040ddc8564896b91f4e5e571c82d6)
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/exceptions.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index 4ed96f0..22666d7 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -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: