aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/errors.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/errors.c b/Python/errors.c
index b6ac2f767a2..9c7b771133d 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -314,8 +314,8 @@ _PyErr_SetLocaleString(PyObject *exception, const char *string)
PyObject* _Py_HOT_FUNCTION
PyErr_Occurred(void)
{
- /* The caller must hold the GIL. */
- assert(PyGILState_Check());
+ /* The caller must hold a thread state. */
+ _Py_AssertHoldsTstate();
PyThreadState *tstate = _PyThreadState_GET();
return _PyErr_Occurred(tstate);