Skip to content

Commit 944c882

Browse files
improve error msgs
1 parent 2316b85 commit 944c882

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/_asynciomodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,7 +2234,7 @@ enter_task(PyObject *loop, PyObject *task)
22342234
_PyThreadStateImpl *ts = (_PyThreadStateImpl *)_PyThreadState_GET();
22352235

22362236
if (ts->asyncio_running_loop != loop) {
2237-
PyErr_Format(PyExc_RuntimeError, "loop mismatch");
2237+
PyErr_Format(PyExc_RuntimeError, "loop %R is not the running loop", loop);
22382238
return -1;
22392239
}
22402240

@@ -2257,7 +2257,7 @@ leave_task(PyObject *loop, PyObject *task)
22572257
_PyThreadStateImpl *ts = (_PyThreadStateImpl *)_PyThreadState_GET();
22582258

22592259
if (ts->asyncio_running_loop != loop) {
2260-
PyErr_Format(PyExc_RuntimeError, "loop mismatch");
2260+
PyErr_Format(PyExc_RuntimeError, "loop %R is not the running loop", loop);
22612261
return -1;
22622262
}
22632263

0 commit comments

Comments
 (0)