mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue 24017: Make PyEval_(Set|Get)CoroutineWrapper private
This commit is contained in:
commit
1b12c554e5
3 changed files with 8 additions and 8 deletions
|
@ -23,8 +23,8 @@ PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj,
|
||||||
#ifndef Py_LIMITED_API
|
#ifndef Py_LIMITED_API
|
||||||
PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
|
PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
|
||||||
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
|
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
|
||||||
PyAPI_FUNC(void) PyEval_SetCoroutineWrapper(PyObject *wrapper);
|
PyAPI_FUNC(void) _PyEval_SetCoroutineWrapper(PyObject *wrapper);
|
||||||
PyAPI_FUNC(PyObject *) PyEval_GetCoroutineWrapper(void);
|
PyAPI_FUNC(PyObject *) _PyEval_GetCoroutineWrapper(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct _frame; /* Avoid including frameobject.h */
|
struct _frame; /* Avoid including frameobject.h */
|
||||||
|
|
|
@ -3936,7 +3936,7 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (co->co_flags & (CO_COROUTINE | CO_ITERABLE_COROUTINE)) {
|
if (co->co_flags & (CO_COROUTINE | CO_ITERABLE_COROUTINE)) {
|
||||||
coroutine_wrapper = PyEval_GetCoroutineWrapper();
|
coroutine_wrapper = _PyEval_GetCoroutineWrapper();
|
||||||
if (coroutine_wrapper != NULL) {
|
if (coroutine_wrapper != NULL) {
|
||||||
PyObject *wrapped =
|
PyObject *wrapped =
|
||||||
PyObject_CallFunction(coroutine_wrapper, "N", gen);
|
PyObject_CallFunction(coroutine_wrapper, "N", gen);
|
||||||
|
@ -4390,7 +4390,7 @@ PyEval_SetTrace(Py_tracefunc func, PyObject *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PyEval_SetCoroutineWrapper(PyObject *wrapper)
|
_PyEval_SetCoroutineWrapper(PyObject *wrapper)
|
||||||
{
|
{
|
||||||
PyThreadState *tstate = PyThreadState_GET();
|
PyThreadState *tstate = PyThreadState_GET();
|
||||||
|
|
||||||
|
@ -4401,7 +4401,7 @@ PyEval_SetCoroutineWrapper(PyObject *wrapper)
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
PyEval_GetCoroutineWrapper(void)
|
_PyEval_GetCoroutineWrapper(void)
|
||||||
{
|
{
|
||||||
PyThreadState *tstate = PyThreadState_GET();
|
PyThreadState *tstate = PyThreadState_GET();
|
||||||
return tstate->coroutine_wrapper;
|
return tstate->coroutine_wrapper;
|
||||||
|
|
|
@ -655,10 +655,10 @@ sys_set_coroutine_wrapper(PyObject *self, PyObject *wrapper)
|
||||||
Py_TYPE(wrapper)->tp_name);
|
Py_TYPE(wrapper)->tp_name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
PyEval_SetCoroutineWrapper(wrapper);
|
_PyEval_SetCoroutineWrapper(wrapper);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PyEval_SetCoroutineWrapper(NULL);
|
_PyEval_SetCoroutineWrapper(NULL);
|
||||||
}
|
}
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
@ -672,7 +672,7 @@ Set a wrapper for coroutine objects."
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sys_get_coroutine_wrapper(PyObject *self, PyObject *args)
|
sys_get_coroutine_wrapper(PyObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
PyObject *wrapper = PyEval_GetCoroutineWrapper();
|
PyObject *wrapper = _PyEval_GetCoroutineWrapper();
|
||||||
if (wrapper == NULL) {
|
if (wrapper == NULL) {
|
||||||
wrapper = Py_None;
|
wrapper = Py_None;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue