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:
Victor Stinner 2022-11-10 16:27:32 +01:00 committed by GitHub
parent 4ce2a202c7
commit c0feb99187
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 77 additions and 156 deletions

View file

@ -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 */