Commit 829b40ae authored by Stefan Behnel's avatar Stefan Behnel

add error case found by CPython test "test_await_15" in test_coroutines_pep492

parent 614e0729
......@@ -142,7 +142,14 @@ static CYTHON_INLINE PyObject* __Pyx__Coroutine_Yield_From(__pyx_CoroutineObject
/* Warning was converted to an error. */
return NULL;
}
retval = __Pyx_Generator_Next(source);
if (unlikely(((__pyx_CoroutineObject*)source)->yieldfrom)) {
PyErr_SetString(
PyExc_RuntimeError,
"coroutine is being awaited already");
retval = NULL;
} else {
retval = __Pyx_Generator_Next(source);
}
if (retval) {
Py_INCREF(source);
gen->yieldfrom = source;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment