summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-06-01 14:02:40 (GMT)
committerGitHub <noreply@github.com>2020-06-01 14:02:40 (GMT)
commit3026cad59b87751a9215111776cac8e819458fce (patch)
treeb994018d331ca9f01f58ebd1a3d05c4f3aa1cdc0 /Python/sysmodule.c
parentdb64f12e4deda2abbafb6d2bd5c06762fca991ff (diff)
downloadcpython-3026cad59b87751a9215111776cac8e819458fce.zip
cpython-3026cad59b87751a9215111776cac8e819458fce.tar.gz
cpython-3026cad59b87751a9215111776cac8e819458fce.tar.bz2
bpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)
Add _Py_EnsureTstateNotNULL(tstate) macro: call Py_FatalError() if tstate is NULL, the error message contains the current function name.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 914beb7..e3fe143 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -457,7 +457,7 @@ static PyObject *
sys_audit(PyObject *self, PyObject *const *args, Py_ssize_t argc)
{
PyThreadState *tstate = _PyThreadState_GET();
- assert(tstate != NULL);
+ _Py_EnsureTstateNotNULL(tstate);
if (argc == 0) {
_PyErr_SetString(tstate, PyExc_TypeError,