gh-99300: Use Py_NewRef() in Objects/ directory (#99335)

Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
Py_XNewRef() in C files of the Objects/ directory.
This commit is contained in:
Victor Stinner 2022-11-10 22:22:02 +01:00 committed by GitHub
parent 2f4af2d99c
commit 584e55bd34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 120 additions and 244 deletions

View file

@ -389,8 +389,7 @@ reversed_new_impl(PyTypeObject *type, PyObject *seq)
return NULL;
ro->index = n-1;
Py_INCREF(seq);
ro->seq = seq;
ro->seq = Py_NewRef(seq);
return (PyObject *)ro;
}