summaryrefslogtreecommitdiffstats
path: root/Objects/funcobject.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2023-08-04 23:24:50 (GMT)
committerGitHub <noreply@github.com>2023-08-04 23:24:50 (GMT)
commit05a824f294f1409f33e32f1799d5b413dcf24445 (patch)
tree173417047763313af6cc1a3c4c54f1d510d28d62 /Objects/funcobject.c
parentec0a0d2bd9faa247d5b3208a8138e4399b2da890 (diff)
downloadcpython-05a824f294f1409f33e32f1799d5b413dcf24445.zip
cpython-05a824f294f1409f33e32f1799d5b413dcf24445.tar.gz
cpython-05a824f294f1409f33e32f1799d5b413dcf24445.tar.bz2
GH-84436: Skip refcounting for known immortals (GH-107605)
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r--Objects/funcobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 7fffa1c..8c0bfac 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -831,8 +831,8 @@ func_clear(PyFunctionObject *op)
// However, name and qualname could be str subclasses, so they
// could have reference cycles. The solution is to replace them
// with a genuinely immutable string.
- Py_SETREF(op->func_name, Py_NewRef(&_Py_STR(empty)));
- Py_SETREF(op->func_qualname, Py_NewRef(&_Py_STR(empty)));
+ Py_SETREF(op->func_name, &_Py_STR(empty));
+ Py_SETREF(op->func_qualname, &_Py_STR(empty));
return 0;
}