summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2022-07-20 06:23:30 (GMT)
committerGitHub <noreply@github.com>2022-07-20 06:23:30 (GMT)
commit1834133e66d95a143c9df5f068b3109927aefd65 (patch)
tree150d0239e46202529647d36e0f4146a9c798ac2a /Objects
parent88e4eeba25df999866b23448b95dce2769c2da86 (diff)
downloadcpython-1834133e66d95a143c9df5f068b3109927aefd65.zip
cpython-1834133e66d95a143c9df5f068b3109927aefd65.tar.gz
cpython-1834133e66d95a143c9df5f068b3109927aefd65.tar.bz2
GH-90699: fix ref counting of static immortal strings (gh-94850)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/boolobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/boolobject.c b/Objects/boolobject.c
index ff72187..8a20e36 100644
--- a/Objects/boolobject.c
+++ b/Objects/boolobject.c
@@ -9,7 +9,8 @@
static PyObject *
bool_repr(PyObject *self)
{
- return self == Py_True ? &_Py_ID(True) : &_Py_ID(False);
+ PyObject *res = self == Py_True ? &_Py_ID(True) : &_Py_ID(False);
+ return Py_NewRef(res);
}
/* Function to return a bool from a C long */