Skip to content

Commit 0ca453d

Browse files
committed
replace Py_IncRef with Py_INCREF
1 parent cedc2c3 commit 0ca453d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Modules/_json.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,21 +1781,21 @@ _encoder_iterate_dict_lock_held(PyEncoderObject *s, PyUnicodeWriter *writer,
17811781
while (PyDict_Next(dct, &pos, &key, &value)) {
17821782
#ifdef Py_GIL_DISABLED
17831783
// gh-119438: in the free-threading build the lock on dct can get suspended
1784-
Py_IncRef(key);
1785-
Py_IncRef(value);
1784+
Py_INCREF(key);
1785+
Py_INCREF(value);
17861786
#endif
17871787
if (encoder_encode_key_value(s, writer, first, dct, key, value,
17881788
indent_level, indent_cache,
17891789
separator) < 0) {
17901790
#ifdef Py_GIL_DISABLED
1791-
Py_DecRef(key);
1792-
Py_DecRef(value);
1791+
Py_DECREF(key);
1792+
Py_DECREF(value);
17931793
#endif
17941794
return -1;
17951795
}
17961796
#ifdef Py_GIL_DISABLED
1797-
Py_DecRef(key);
1798-
Py_DecRef(value);
1797+
Py_DECREF(key);
1798+
Py_DECREF(value);
17991799
#endif
18001800
}
18011801
return 0;
@@ -1902,25 +1902,25 @@ _encoder_iterate_fast_seq_lock_held(PyEncoderObject *s, PyUnicodeWriter *writer,
19021902
PyObject *obj = PySequence_Fast_GET_ITEM(s_fast, i);
19031903
#ifdef Py_GIL_DISABLED
19041904
// gh-119438: in the free-threading build the lock on s_fast can get suspended
1905-
Py_IncRef(obj);
1905+
Py_INCREF(obj);
19061906
#endif
19071907
if (i) {
19081908
if (PyUnicodeWriter_WriteStr(writer, separator) < 0) {
19091909
#ifdef Py_GIL_DISABLED
1910-
Py_DecRef(obj);
1910+
Py_DECREF(obj);
19111911
#endif
19121912
return -1;
19131913
}
19141914
}
19151915
if (encoder_listencode_obj(s, writer, obj, indent_level, indent_cache)) {
19161916
_PyErr_FormatNote("when serializing %T item %zd", seq, i);
19171917
#ifdef Py_GIL_DISABLED
1918-
Py_DecRef(obj);
1918+
Py_DECREF(obj);
19191919
#endif
19201920
return -1;
19211921
}
19221922
#ifdef Py_GIL_DISABLED
1923-
Py_DecRef(obj);
1923+
Py_DECREF(obj);
19241924
#endif
19251925
}
19261926
return 0;

0 commit comments

Comments
 (0)