mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Merge 3.5 (issue #25888)
This commit is contained in:
commit
d2dc15b26b
4 changed files with 40 additions and 6 deletions
|
@ -2021,6 +2021,21 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
|||
|
||||
Py_DECREF(iterable);
|
||||
|
||||
if (iter != NULL && PyCoro_CheckExact(iter)) {
|
||||
PyObject *yf = _PyGen_yf((PyGenObject*)iter);
|
||||
if (yf != NULL) {
|
||||
/* `iter` is a coroutine object that is being
|
||||
awaited, `yf` is a pointer to the current awaitable
|
||||
being awaited on. */
|
||||
Py_DECREF(yf);
|
||||
Py_CLEAR(iter);
|
||||
PyErr_SetString(
|
||||
PyExc_RuntimeError,
|
||||
"coroutine is being awaited already");
|
||||
/* The code below jumps to `error` if `iter` is NULL. */
|
||||
}
|
||||
}
|
||||
|
||||
SET_TOP(iter); /* Even if it's NULL */
|
||||
|
||||
if (iter == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue