Skip to content

Commit ac173b7

Browse files
committed
avoid changing ABI
1 parent da0b022 commit ac173b7

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

Include/internal/pycore_ceval.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ PyAPI_DATA(const conversion_func) _PyEval_ConversionFuncs[];
247247

248248
PyAPI_FUNC(int) _PyEval_CheckExceptStarTypeValid(PyThreadState *tstate, PyObject* right);
249249
PyAPI_FUNC(int) _PyEval_CheckExceptTypeValid(PyThreadState *tstate, PyObject* right);
250-
PyAPI_FUNC(int) _PyEval_ExceptionGroupMatch(_PyInterpreterFrame *, PyObject* exc_value, PyObject *match_type, PyObject **match, PyObject **rest);
250+
PyAPI_FUNC(int) _PyEval_ExceptionGroupMatch(PyObject* exc_value, PyObject *match_type, PyObject **match, PyObject **rest);
251251
PyAPI_FUNC(void) _PyEval_FormatAwaitableError(PyThreadState *tstate, PyTypeObject *type, int oparg);
252252
PyAPI_FUNC(void) _PyEval_FormatExcCheckArg(PyThreadState *tstate, PyObject *exc, const char *format_str, PyObject *obj);
253253
PyAPI_FUNC(void) _PyEval_FormatExcUnbound(PyThreadState *tstate, PyCodeObject *co, int oparg);
@@ -258,6 +258,7 @@ PyAPI_FUNC(int) _PyEval_UnpackIterable(PyThreadState *tstate, PyObject *v, int a
258258
PyAPI_FUNC(void) _PyEval_MonitorRaise(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_CODEUNIT *instr);
259259
PyAPI_FUNC(void) _PyEval_FrameClearAndPop(PyThreadState *tstate, _PyInterpreterFrame *frame);
260260

261+
extern int _Py_exception_group_match(_PyInterpreterFrame *frame, PyObject* exc_value, PyObject *match_type, PyObject **match, PyObject **rest);
261262

262263
/* Bits that can be set in PyThreadState.eval_breaker */
263264
#define _PY_GIL_DROP_REQUEST_BIT (1U << 0)

Python/bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,8 +2340,8 @@ dummy_func(
23402340

23412341
match = NULL;
23422342
rest = NULL;
2343-
int res = _PyEval_ExceptionGroupMatch(frame, exc_value, match_type,
2344-
&match, &rest);
2343+
int res = _Py_exception_group_match(frame, exc_value, match_type,
2344+
&match, &rest);
23452345
DECREF_INPUTS();
23462346
ERROR_IF(res < 0, error);
23472347

Python/ceval.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,8 +1992,8 @@ do_raise(PyThreadState *tstate, PyObject *exc, PyObject *cause)
19921992
*/
19931993

19941994
int
1995-
_PyEval_ExceptionGroupMatch(_PyInterpreterFrame *frame, PyObject* exc_value,
1996-
PyObject *match_type, PyObject **match, PyObject **rest)
1995+
_Py_exception_group_match(_PyInterpreterFrame *frame, PyObject* exc_value,
1996+
PyObject *match_type, PyObject **match, PyObject **rest)
19971997
{
19981998
if (Py_IsNone(exc_value)) {
19991999
*match = Py_NewRef(Py_None);
@@ -2073,6 +2073,16 @@ _PyEval_ExceptionGroupMatch(_PyInterpreterFrame *frame, PyObject* exc_value,
20732073
return 0;
20742074
}
20752075

2076+
int
2077+
_PyEval_ExceptionGroupMatch(PyObject* exc_value, PyObject *match_type,
2078+
PyObject **match, PyObject **rest)
2079+
{
2080+
PyThreadState *tstate = _PyThreadState_GET();
2081+
_PyInterpreterFrame *frame = _PyThreadState_GetFrame(tstate);
2082+
return _Py_exception_group_match(frame, exc_value, match_type, match, rest);
2083+
}
2084+
2085+
20762086
/* Iterate v argcnt times and store the results on the stack (via decreasing
20772087
sp). Return 1 for success, 0 if error.
20782088

Python/executor_cases.c.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)