diff options
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index cb5a4beb2a..9263df9b8f 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4143,19 +4143,8 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals, /* Handle generator/coroutine/asynchronous generator */ if (co->co_flags & (CO_GENERATOR | CO_COROUTINE | CO_ASYNC_GENERATOR)) { PyObject *gen; - PyObject *coro_wrapper = tstate->coroutine_wrapper; int is_coro = co->co_flags & CO_COROUTINE; - if (is_coro && tstate->in_coroutine_wrapper) { - assert(coro_wrapper != NULL); - _PyErr_Format(tstate, PyExc_RuntimeError, - "coroutine wrapper %.200R attempted " - "to recursively wrap %.200R", - coro_wrapper, - co); - goto fail; - } - /* Don't need to keep the reference to f_back, it will be set * when the generator is resumed. */ Py_CLEAR(f->f_back); @@ -4175,14 +4164,6 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals, _PyObject_GC_TRACK(f); - if (is_coro && coro_wrapper != NULL) { - PyObject *wrapped; - tstate->in_coroutine_wrapper = 1; - wrapped = PyObject_CallFunction(coro_wrapper, "N", gen); - tstate->in_coroutine_wrapper = 0; - return wrapped; - } - return gen; } @@ -4634,26 +4615,6 @@ _PyEval_GetCoroutineOriginTrackingDepth(void) } void -_PyEval_SetCoroutineWrapper(PyObject *wrapper) -{ - PyThreadState *tstate = _PyThreadState_GET(); - - if (PySys_Audit("sys.set_coroutine_wrapper", NULL) < 0) { - return; - } - - Py_XINCREF(wrapper); - Py_XSETREF(tstate->coroutine_wrapper, wrapper); -} - -PyObject * -_PyEval_GetCoroutineWrapper(void) -{ - PyThreadState *tstate = _PyThreadState_GET(); - return tstate->coroutine_wrapper; -} - -void _PyEval_SetAsyncGenFirstiter(PyObject *firstiter) { PyThreadState *tstate = _PyThreadState_GET(); |