From 6d62dc1ea4e191b8486e80a85ca0694215375424 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 3 Jun 2020 20:16:39 +0200 Subject: [3.9] bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578) (GH-20618) * 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. (cherry picked from commit 3026cad59b87751a9215111776cac8e819458fce) * bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578) PyOS_InterruptOccurred() now fails with a fatal error if it is called with the GIL released. (cherry picked from commit cbe129692293251e7fbcea9ff0d822824d90c140) --- Python/errors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/errors.c') 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; -- cgit v1.2.1