summaryrefslogtreecommitdiff
path: root/Modules/_functoolsmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-07 00:38:59 +0100
committerGitHub <noreply@github.com>2020-02-07 00:38:59 +0100
commita93c51e3a8e15f1a486d11d5b55a64f3381babe0 (patch)
treea84997f6ca55cb27c92248dc04eda44e01a07a2a /Modules/_functoolsmodule.c
parent446463f8dbce0556be8020914f37089b63bb8ab6 (diff)
downloadcpython-git-a93c51e3a8e15f1a486d11d5b55a64f3381babe0.tar.gz
bpo-39573: Use Py_REFCNT() macro (GH-18388)
Replace direct acccess to PyObject.ob_refcnt with usage of the Py_REFCNT() macro.
Diffstat (limited to 'Modules/_functoolsmodule.c')
-rw-r--r--Modules/_functoolsmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index 987087b1ac..50d8c58e95 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -649,7 +649,7 @@ functools_reduce(PyObject *self, PyObject *args)
for (;;) {
PyObject *op2;
- if (args->ob_refcnt > 1) {
+ if (Py_REFCNT(args) > 1) {
Py_DECREF(args);
if ((args = PyTuple_New(2)) == NULL)
goto Fail;
@@ -666,7 +666,7 @@ functools_reduce(PyObject *self, PyObject *args)
result = op2;
else {
/* Update the args tuple in-place */
- assert(args->ob_refcnt == 1);
+ assert(Py_REFCNT(args) == 1);
Py_XSETREF(_PyTuple_ITEMS(args)[0], result);
Py_XSETREF(_PyTuple_ITEMS(args)[1], op2);
if ((result = PyObject_Call(func, args, NULL)) == NULL) {