summaryrefslogtreecommitdiffstats
path: root/Objects/funcobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-16 09:39:47 (GMT)
committerGitHub <noreply@github.com>2022-11-16 09:39:47 (GMT)
commit3ed8803ef59f80e03c40b100b04c2e13f138ceed (patch)
treeec9ce18edd242485d4e3198d8e62924e1616c4ea /Objects/funcobject.c
parentea88d34de27ba2b3acaeb03c7dc7829dff40ea5c (diff)
downloadcpython-3ed8803ef59f80e03c40b100b04c2e13f138ceed.zip
cpython-3ed8803ef59f80e03c40b100b04c2e13f138ceed.tar.gz
cpython-3ed8803ef59f80e03c40b100b04c2e13f138ceed.tar.bz2
gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513)
Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r--Objects/funcobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 7f5a71a..80117bf 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -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);