mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513)
Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
This commit is contained in:
parent
ea88d34de2
commit
3ed8803ef5
12 changed files with 22 additions and 44 deletions
|
@ -45,8 +45,7 @@ PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname
|
|||
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
|
||||
PyCodeObject *code_obj = (PyCodeObject *)code;
|
||||
Py_INCREF(code_obj);
|
||||
PyCodeObject *code_obj = (PyCodeObject *)Py_NewRef(code);
|
||||
|
||||
PyObject *name = code_obj->co_name;
|
||||
assert(name != NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue