Skip to content

Commit 7b87e8a

Browse files
authored
gh-90699: Remove usage of _Py_IDENTIFIER from bisect module. (GH-91522)
1 parent 45e8c9d commit 7b87e8a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Modules/_bisectmodule.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru).
44
*/
55

66
#define PY_SSIZE_T_CLEAN
7-
#define NEEDS_PY_IDENTIFIER
87
#include "Python.h"
98

109
/*[clinic input]
@@ -14,8 +13,6 @@ module _bisect
1413

1514
#include "clinic/_bisectmodule.c.h"
1615

17-
_Py_IDENTIFIER(insert);
18-
1916
static inline Py_ssize_t
2017
internal_bisect_right(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t hi,
2118
PyObject* key)
@@ -132,7 +129,7 @@ _bisect_insort_right_impl(PyObject *module, PyObject *a, PyObject *x,
132129
return NULL;
133130
}
134131
else {
135-
result = _PyObject_CallMethodId(a, &PyId_insert, "nO", index, x);
132+
result = PyObject_CallMethod(a, "insert", "nO", index, x);
136133
if (result == NULL)
137134
return NULL;
138135
Py_DECREF(result);
@@ -258,7 +255,7 @@ _bisect_insort_left_impl(PyObject *module, PyObject *a, PyObject *x,
258255
if (PyList_Insert(a, index, x) < 0)
259256
return NULL;
260257
} else {
261-
result = _PyObject_CallMethodId(a, &PyId_insert, "nO", index, x);
258+
result = PyObject_CallMethod(a, "insert", "nO", index, x);
262259
if (result == NULL)
263260
return NULL;
264261
Py_DECREF(result);

0 commit comments

Comments
 (0)