mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-99300: Use Py_NewRef() in Python/ directory (#99302)
Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Python/ directory.
This commit is contained in:
parent
f883b7f8ee
commit
d8f239d86e
14 changed files with 41 additions and 80 deletions
|
@ -533,8 +533,7 @@ make_const_tuple(asdl_expr_seq *elts)
|
|||
for (int i = 0; i < asdl_seq_LEN(elts); i++) {
|
||||
expr_ty e = (expr_ty)asdl_seq_GET(elts, i);
|
||||
PyObject *v = e->v.Constant.value;
|
||||
Py_INCREF(v);
|
||||
PyTuple_SET_ITEM(newval, i, v);
|
||||
PyTuple_SET_ITEM(newval, i, Py_NewRef(v));
|
||||
}
|
||||
return newval;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue