Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Manual fix: use _impl() functions
  • Loading branch information
vstinner committed Feb 28, 2025
commit a09a5fe9796fa745db7387ef1871818b249d4df6
4 changes: 2 additions & 2 deletions Modules/_collectionsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ deque_extend_impl(dequeobject *deque, PyObject *iterable)
PyObject *s = PySequence_List(iterable);
if (s == NULL)
return NULL;
result = deque_extend(deque, s);
result = deque_extend_impl(deque, s);
Py_DECREF(s);
return result;
}
Expand Down Expand Up @@ -578,7 +578,7 @@ deque_inplace_concat(PyObject *self, PyObject *other)
PyObject *result;

// deque_extend is thread-safe
result = deque_extend(deque, other);
result = deque_extend_impl(deque, other);
if (result == NULL)
return result;
Py_INCREF(deque);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_io/bufferedio.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ _io__Buffered_close_impl(buffered *self)
}

if (self->finalizing) {
PyObject *r = _io__Buffered__dealloc_warn(self, (PyObject *) self);
PyObject *r = _io__Buffered__dealloc_warn_impl(self, (PyObject *) self);
Comment thread
vstinner marked this conversation as resolved.
Outdated
if (r)
Py_DECREF(r);
else
Expand Down
4 changes: 2 additions & 2 deletions Modules/_io/bytesio.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ bytesio_setstate(PyObject *op, PyObject *state)

/* Set the value of the internal buffer. If state[0] does not support the
buffer protocol, bytesio_write will raise the appropriate TypeError. */
result = _io_BytesIO_write(self, PyTuple_GET_ITEM(state, 0));
result = _io_BytesIO_write_impl(self, PyTuple_GET_ITEM(state, 0));
if (result == NULL)
return NULL;
Py_DECREF(result);
Expand Down Expand Up @@ -958,7 +958,7 @@ _io_BytesIO___init___impl(bytesio *self, PyObject *initvalue)
}
else {
PyObject *res;
res = _io_BytesIO_write(self, initvalue);
res = _io_BytesIO_write_impl(self, initvalue);
if (res == NULL)
return -1;
Py_DECREF(res);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -2691,7 +2691,7 @@ iter_unpack_impl(PyObject *module, PyStructObject *s_object,
PyObject *buffer)
/*[clinic end generated code: output=0ae50e250d20e74d input=b214a58869a3c98d]*/
{
return Struct_iter_unpack(s_object, buffer);
return Struct_iter_unpack_impl(s_object, buffer);
}

static struct PyMethodDef module_functions[] = {
Expand Down
2 changes: 1 addition & 1 deletion Objects/listobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ list_extend_impl(PyListObject *self, PyObject *iterable)
PyObject *
_PyList_Extend(PyListObject *self, PyObject *iterable)
{
return list_extend(self, iterable);
return list_extend_impl(self, iterable);
}

int
Expand Down
16 changes: 8 additions & 8 deletions Objects/setobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,7 @@ set_xor(PyObject *self, PyObject *other)
if (!PyAnySet_Check(self) || !PyAnySet_Check(other))
Py_RETURN_NOTIMPLEMENTED;
PySetObject *so = _PySet_CAST(self);
return set_symmetric_difference(so, other);
return set_symmetric_difference_impl(so, other);
}

static PyObject *
Expand All @@ -2016,7 +2016,7 @@ set_ixor(PyObject *self, PyObject *other)
Py_RETURN_NOTIMPLEMENTED;
PySetObject *so = _PySet_CAST(self);

result = set_symmetric_difference_update(so, other);
result = set_symmetric_difference_update_impl(so, other);
if (result == NULL)
return NULL;
Py_DECREF(result);
Expand Down Expand Up @@ -2083,7 +2083,7 @@ set_issuperset_impl(PySetObject *so, PyObject *other)
/*[clinic end generated code: output=ecf00ce552c09461 input=5f2e1f262e6e4ccc]*/
{
if (PyAnySet_Check(other)) {
return set_issubset((PySetObject *)other, (PyObject *)so);
return set_issubset_impl((PySetObject *)other, (PyObject *)so);
}

PyObject *key, *it = PyObject_GetIter(other);
Expand Down Expand Up @@ -2127,7 +2127,7 @@ set_richcompare(PyObject *self, PyObject *w, int op)
((PySetObject *)w)->hash != -1 &&
v->hash != ((PySetObject *)w)->hash)
Py_RETURN_FALSE;
return set_issubset(v, w);
return set_issubset_impl(v, w);
case Py_NE:
r1 = set_richcompare((PyObject*)v, w, Py_EQ);
if (r1 == NULL)
Expand All @@ -2138,17 +2138,17 @@ set_richcompare(PyObject *self, PyObject *w, int op)
return NULL;
return PyBool_FromLong(!r2);
case Py_LE:
return set_issubset(v, w);
return set_issubset_impl(v, w);
case Py_GE:
return set_issuperset(v, w);
return set_issuperset_impl(v, w);
case Py_LT:
if (PySet_GET_SIZE(v) >= PySet_GET_SIZE(w))
Py_RETURN_FALSE;
return set_issubset(v, w);
return set_issubset_impl(v, w);
case Py_GT:
if (PySet_GET_SIZE(v) <= PySet_GET_SIZE(w))
Py_RETURN_FALSE;
return set_issuperset(v, w);
return set_issuperset_impl(v, w);
}
Py_RETURN_NOTIMPLEMENTED;
}
Expand Down