mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
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:
parent
446463f8db
commit
a93c51e3a8
9 changed files with 42 additions and 38 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue