mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
db64f12e4d
commit
3026cad59b
6 changed files with 40 additions and 31 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue