static PyObject * unicode_concatenate(PyObject *, PyObject *,
PyFrameObject *, unsigned char *);
static PyObject * special_lookup(PyObject *, _Py_Identifier *);
+static PyObject * apply_coroutine_wrapper(PyObject *);
+
#define NAME_ERROR_MSG \
"name '%.200s' is not defined"
return NULL;
if (co->co_flags & (CO_COROUTINE | CO_ITERABLE_COROUTINE))
- return _PyEval_ApplyCoroutineWrapper(gen);
+ return apply_coroutine_wrapper(gen);
return gen;
}
return tstate->coroutine_wrapper;
}
-PyObject *
-_PyEval_ApplyCoroutineWrapper(PyObject *gen)
-{
- PyObject *wrapped;
- PyThreadState *tstate = PyThreadState_GET();
- PyObject *wrapper = tstate->coroutine_wrapper;
-
- if (tstate->in_coroutine_wrapper) {
- assert(wrapper != NULL);
- PyErr_Format(PyExc_RuntimeError,
- "coroutine wrapper %.150R attempted "
- "to recursively wrap %.150R",
- wrapper,
- gen);
- return NULL;
- }
-
- if (wrapper == NULL) {
- return gen;
- }
-
- tstate->in_coroutine_wrapper = 1;
- wrapped = PyObject_CallFunction(wrapper, "N", gen);
- tstate->in_coroutine_wrapper = 0;
- return wrapped;
-}
-
PyObject *
PyEval_GetBuiltins(void)
{
return res;
}
+static PyObject *
+apply_coroutine_wrapper(PyObject *gen)
+{
+ PyObject *wrapped;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject *wrapper = tstate->coroutine_wrapper;
+
+ if (tstate->in_coroutine_wrapper) {
+ assert(wrapper != NULL);
+ PyErr_Format(PyExc_RuntimeError,
+ "coroutine wrapper %.200R attempted "
+ "to recursively wrap %.200R",
+ wrapper,
+ gen);
+ return NULL;
+ }
+
+ if (wrapper == NULL) {
+ return gen;
+ }
+
+ tstate->in_coroutine_wrapper = 1;
+ wrapped = PyObject_CallFunction(wrapper, "N", gen);
+ tstate->in_coroutine_wrapper = 0;
+ return wrapped;
+}
+
#ifdef DYNAMIC_EXECUTION_PROFILE
static PyObject *