mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* implementation in the unstable API (#105072)
This commit is contained in:
parent
bd98b65e97
commit
b7aadb4583
7 changed files with 196 additions and 1 deletions
|
@ -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:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue