gh-90699: Remove usage of _Py_IDENTIFIER from bisect module. (GH-91522)

This commit is contained in:
Dong-hee Na 2022-04-14 14:57:25 +09:00 committed by GitHub
parent 45e8c9d43f
commit 7b87e8af0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,6 @@ Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru).
*/
#define PY_SSIZE_T_CLEAN
#define NEEDS_PY_IDENTIFIER
#include "Python.h"
/*[clinic input]
@ -14,8 +13,6 @@ module _bisect
#include "clinic/_bisectmodule.c.h"
_Py_IDENTIFIER(insert);
static inline Py_ssize_t
internal_bisect_right(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t hi,
PyObject* key)
@ -132,7 +129,7 @@ _bisect_insort_right_impl(PyObject *module, PyObject *a, PyObject *x,
return NULL;
}
else {
result = _PyObject_CallMethodId(a, &PyId_insert, "nO", index, x);
result = PyObject_CallMethod(a, "insert", "nO", index, x);
if (result == NULL)
return NULL;
Py_DECREF(result);
@ -258,7 +255,7 @@ _bisect_insort_left_impl(PyObject *module, PyObject *a, PyObject *x,
if (PyList_Insert(a, index, x) < 0)
return NULL;
} else {
result = _PyObject_CallMethodId(a, &PyId_insert, "nO", index, x);
result = PyObject_CallMethod(a, "insert", "nO", index, x);
if (result == NULL)
return NULL;
Py_DECREF(result);