mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-90699: fix ref counting of static immortal strings (gh-94850)
(cherry picked from commit 1834133e66
)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
This commit is contained in:
parent
b3aec3ea58
commit
84d58ad17b
3 changed files with 4 additions and 2 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue