From d371454dad11b6e9de53cb3747c1cf25b3bb6d9f Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Tue, 19 Mar 2019 13:58:00 +0100 Subject: [PATCH] do not grab the result if it was in a gatherop --- src/python.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python.c b/src/python.c index 2c0e646..67bf7a6 100644 --- a/src/python.c +++ b/src/python.c @@ -542,7 +542,7 @@ python_coro_run(struct python_coro *coro) item = _PyGen_Send((PyGenObject *)coro->obj, NULL); if (item == NULL) { - if (PyErr_Occurred() && + if (coro->gatherop == NULL && PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) { PyErr_Fetch(&type, &coro->result, &traceback); Py_DECREF(type);