Skip to content

Commit

Permalink
pythongh-90699: Remove usage of _Py_IDENTIFIER from bisect module. (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 authored Apr 14, 2022
1 parent 45e8c9d commit 7b87e8a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Modules/_bisectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7b87e8a

Please sign in to comment.