gh-101799: implement PREP_RERAISE_STAR as an intrinsic function (#101800)

This commit is contained in:
Irit Katriel 2023-02-14 11:54:13 +00:00 committed by GitHub
parent 3690688149
commit 81e3aa835c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 107 additions and 73 deletions

View file

@ -9,6 +9,7 @@
#include "pycore_pyerrors.h"
/******** Unary functions ********/
static PyObject *
no_intrinsic(PyThreadState* tstate, PyObject *unused)
@ -208,3 +209,20 @@ _PyIntrinsics_UnaryFunctions[] = {
[INTRINSIC_UNARY_POSITIVE] = unary_pos,
[INTRINSIC_LIST_TO_TUPLE] = list_to_tuple,
};
/******** Binary functions ********/
static PyObject *
prep_reraise_star(PyThreadState* unused, PyObject *orig, PyObject *excs)
{
assert(PyList_Check(excs));
return _PyExc_PrepReraiseStar(orig, excs);
}
instrinsic_func2
_PyIntrinsics_BinaryFunctions[] = {
[INTRINSIC_PREP_RERAISE_STAR] = prep_reraise_star,
};