summaryrefslogtreecommitdiffstats
path: root/Objects/boolobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-09-21 21:04:34 (GMT)
committerGitHub <noreply@github.com>2021-09-21 21:04:34 (GMT)
commit79a31480992c3fa5890fc7a6c5d9af6d337d5844 (patch)
treea3ef89bb0340669e86c52f5b924cfb0e71845956 /Objects/boolobject.c
parentf604cf1c377a7648e0686044e6e49900bfc9feef (diff)
downloadcpython-79a31480992c3fa5890fc7a6c5d9af6d337d5844.zip
cpython-79a31480992c3fa5890fc7a6c5d9af6d337d5844.tar.gz
cpython-79a31480992c3fa5890fc7a6c5d9af6d337d5844.tar.bz2
bpo-45061: Detect refcount bug on empty tuple singleton (GH-28503)
Detect refcount bugs in C extensions when the empty tuple singleton is destroyed by mistake. Add the _Py_FatalRefcountErrorFunc() function.
Diffstat (limited to 'Objects/boolobject.c')
-rw-r--r--Objects/boolobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/boolobject.c b/Objects/boolobject.c
index bc1666f..c72243a 100644
--- a/Objects/boolobject.c
+++ b/Objects/boolobject.c
@@ -1,6 +1,7 @@
/* Boolean type, a subtype of int */
#include "Python.h"
+#include "pycore_pyerrors.h" // _Py_FatalRefcountError()
#include "longintrepr.h"
/* We define bool_repr to return "False" or "True" */
@@ -156,8 +157,7 @@ static PyNumberMethods bool_as_number = {
static void _Py_NO_RETURN
bool_dealloc(PyObject* Py_UNUSED(ignore))
{
- Py_FatalError("deallocating True or False likely caused by "
- "a refcount bug in a C extension");
+ _Py_FatalRefcountError("deallocating True or False");
}
/* The type object for bool. Note that this cannot be subclassed! */