mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +00:00
gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513)
Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
This commit is contained in:
parent
ea88d34de2
commit
3ed8803ef5
12 changed files with 22 additions and 44 deletions
|
@ -1787,8 +1787,7 @@ ndarray_subscript(NDArrayObject *self, PyObject *key)
|
|||
return unpack_single(base->buf, base->format, base->itemsize);
|
||||
}
|
||||
else if (key == Py_Ellipsis) {
|
||||
Py_INCREF(self);
|
||||
return (PyObject *)self;
|
||||
return Py_NewRef(self);
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError, "invalid indexing of scalar");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue