From 1a4509b593e435aad5c507efd56830cc73ae5632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Tue, 14 Feb 2023 11:15:07 +0100 Subject: [PATCH] Use _Py_EnterRecursiveCall internal API in _bisectmodule.c --- Modules/_bisectmodule.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c index 9ceb3ae46fe56d..37f87c26ec6782 100644 --- a/Modules/_bisectmodule.c +++ b/Modules/_bisectmodule.c @@ -5,6 +5,7 @@ Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru). #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_ceval.h" // _Py_EnterRecursiveCall() /*[clinic input] module _bisect @@ -66,7 +67,7 @@ internal_bisect_right(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t if (sq_item == NULL) { return -1; } - if (Py_EnterRecursiveCall("in _bisect.bisect_right") < 0) { + if (_Py_EnterRecursiveCall("in _bisect.bisect_right") < 0) { return -1; } PyTypeObject *tp = Py_TYPE(item); @@ -136,10 +137,10 @@ internal_bisect_right(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t else lo = mid + 1; } - Py_LeaveRecursiveCall(); + _Py_LeaveRecursiveCall(); return lo; error: - Py_LeaveRecursiveCall(); + _Py_LeaveRecursiveCall(); Py_XDECREF(litem); return -1; } @@ -246,7 +247,7 @@ internal_bisect_left(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t h if (sq_item == NULL) { return -1; } - if (Py_EnterRecursiveCall("in _bisect.bisect_left") < 0) { + if (_Py_EnterRecursiveCall("in _bisect.bisect_left") < 0) { return -1; } PyTypeObject *tp = Py_TYPE(item); @@ -316,10 +317,10 @@ internal_bisect_left(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t h else hi = mid; } - Py_LeaveRecursiveCall(); + _Py_LeaveRecursiveCall(); return lo; error: - Py_LeaveRecursiveCall(); + _Py_LeaveRecursiveCall(); Py_XDECREF(litem); return -1; }