diff options
author | Victor Stinner <vstinner@python.org> | 2022-11-16 09:39:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 09:39:47 (GMT) |
commit | 3ed8803ef59f80e03c40b100b04c2e13f138ceed (patch) | |
tree | ec9ce18edd242485d4e3198d8e62924e1616c4ea /Objects/funcobject.c | |
parent | ea88d34de27ba2b3acaeb03c7dc7829dff40ea5c (diff) | |
download | cpython-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.c | 3 |
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); |