mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
gh-99300: Use Py_NewRef() in Objects/ directory (#99332)
Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Objects/ directory.
This commit is contained in:
parent
4ce2a202c7
commit
c0feb99187
9 changed files with 77 additions and 156 deletions
|
|
@ -23,8 +23,7 @@ PyObject *PyBool_FromLong(long ok)
|
|||
result = Py_True;
|
||||
else
|
||||
result = Py_False;
|
||||
Py_INCREF(result);
|
||||
return result;
|
||||
return Py_NewRef(result);
|
||||
}
|
||||
|
||||
/* We define bool_new to always return either Py_True or Py_False */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue