summaryrefslogtreecommitdiffstats
path: root/Objects/enumobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-06 23:38:59 (GMT)
committerGitHub <noreply@github.com>2020-02-06 23:38:59 (GMT)
commita93c51e3a8e15f1a486d11d5b55a64f3381babe0 (patch)
treea84997f6ca55cb27c92248dc04eda44e01a07a2a /Objects/enumobject.c
parent446463f8dbce0556be8020914f37089b63bb8ab6 (diff)
downloadcpython-a93c51e3a8e15f1a486d11d5b55a64f3381babe0.zip
cpython-a93c51e3a8e15f1a486d11d5b55a64f3381babe0.tar.gz
cpython-a93c51e3a8e15f1a486d11d5b55a64f3381babe0.tar.bz2
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 'Objects/enumobject.c')
-rw-r--r--Objects/enumobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/enumobject.c b/Objects/enumobject.c
index 4786297..75703be 100644
--- a/Objects/enumobject.c
+++ b/Objects/enumobject.c
@@ -122,7 +122,7 @@ enum_next_long(enumobject *en, PyObject* next_item)
}
en->en_longindex = stepped_up;
- if (result->ob_refcnt == 1) {
+ if (Py_REFCNT(result) == 1) {
Py_INCREF(result);
old_index = PyTuple_GET_ITEM(result, 0);
old_item = PyTuple_GET_ITEM(result, 1);
@@ -167,7 +167,7 @@ enum_next(enumobject *en)
}
en->en_index++;
- if (result->ob_refcnt == 1) {
+ if (Py_REFCNT(result) == 1) {
Py_INCREF(result);
old_index = PyTuple_GET_ITEM(result, 0);
old_item = PyTuple_GET_ITEM(result, 1);