bpo-39573: Use Py_REFCNT() macro (GH-18388)

Replace direct acccess to PyObject.ob_refcnt with usage of the
Py_REFCNT() macro.
This commit is contained in:
Victor Stinner 2020-02-07 00:38:59 +01:00 committed by GitHub
parent 446463f8db
commit a93c51e3a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 42 additions and 38 deletions

View file

@ -153,7 +153,7 @@ int
PyTuple_SetItem(PyObject *op, Py_ssize_t i, PyObject *newitem)
{
PyObject **p;
if (!PyTuple_Check(op) || op->ob_refcnt != 1) {
if (!PyTuple_Check(op) || Py_REFCNT(op) != 1) {
Py_XDECREF(newitem);
PyErr_BadInternalCall();
return -1;