summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-06-01 16:02:40 +0200
committerGitHub <noreply@github.com>2020-06-01 16:02:40 +0200
commit3026cad59b87751a9215111776cac8e819458fce (patch)
treeb994018d331ca9f01f58ebd1a3d05c4f3aa1cdc0 /Python/errors.c
parentdb64f12e4deda2abbafb6d2bd5c06762fca991ff (diff)
downloadcpython-git-3026cad59b87751a9215111776cac8e819458fce.tar.gz
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/errors.c')
-rw-r--r--Python/errors.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 70365aaca5..5d1725679c 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -1426,7 +1426,7 @@ void
_PyErr_WriteUnraisableMsg(const char *err_msg_str, PyObject *obj)
{
PyThreadState *tstate = _PyThreadState_GET();
- assert(tstate != NULL);
+ _Py_EnsureTstateNotNULL(tstate);
PyObject *err_msg = NULL;
PyObject *exc_type, *exc_value, *exc_tb;