diff options
author | Matthias Bussonnier <bussonniermatthias@gmail.com> | 2019-05-28 00:10:59 -0700 |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-05-28 00:10:59 -0700 |
commit | 3880f263d2994fb1eba25835dddccb0cf696fdf0 (patch) | |
tree | 0c40e3b7cab9b3aa59600cec290548709d7c7dc4 /Python/sysmodule.c | |
parent | 436c2b0d67da68465e709a96daac7340af3a5238 (diff) | |
download | cpython-git-3880f263d2994fb1eba25835dddccb0cf696fdf0.tar.gz |
bpo-36933: Remove sys.set_coroutine_wrapper (marked for removal in 3.8) (GH-13577)
It has been documented as deprecated and to be removed in 3.8;
From a comment on another thread – which I can't find ; leave get_coro_wrapper() for now, but always return `None`.
https://bugs.python.org/issue36933
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 24018e25fa..343601ec85 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1158,62 +1158,6 @@ sys_get_coroutine_origin_tracking_depth_impl(PyObject *module) return _PyEval_GetCoroutineOriginTrackingDepth(); } -/*[clinic input] -sys.set_coroutine_wrapper - - wrapper: object - / - -Set a wrapper for coroutine objects. -[clinic start generated code]*/ - -static PyObject * -sys_set_coroutine_wrapper(PyObject *module, PyObject *wrapper) -/*[clinic end generated code: output=9c7db52d65f6b188 input=df6ac09a06afef34]*/ -{ - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "set_coroutine_wrapper is deprecated", 1) < 0) { - return NULL; - } - - if (wrapper != Py_None) { - if (!PyCallable_Check(wrapper)) { - PyErr_Format(PyExc_TypeError, - "callable expected, got %.50s", - Py_TYPE(wrapper)->tp_name); - return NULL; - } - _PyEval_SetCoroutineWrapper(wrapper); - } - else { - _PyEval_SetCoroutineWrapper(NULL); - } - Py_RETURN_NONE; -} - -/*[clinic input] -sys.get_coroutine_wrapper - -Return the wrapper for coroutines set by sys.set_coroutine_wrapper. -[clinic start generated code]*/ - -static PyObject * -sys_get_coroutine_wrapper_impl(PyObject *module) -/*[clinic end generated code: output=b74a7e4b14fe898e input=ef0351fb9ece0bb4]*/ -{ - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "get_coroutine_wrapper is deprecated", 1) < 0) { - return NULL; - } - PyObject *wrapper = _PyEval_GetCoroutineWrapper(); - if (wrapper == NULL) { - wrapper = Py_None; - } - Py_INCREF(wrapper); - return wrapper; -} - - static PyTypeObject AsyncGenHooksType; PyDoc_STRVAR(asyncgen_hooks_doc, @@ -2002,8 +1946,6 @@ static PyMethodDef sys_methods[] = { SYS__DEBUGMALLOCSTATS_METHODDEF SYS_SET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF SYS_GET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF - SYS_SET_COROUTINE_WRAPPER_METHODDEF - SYS_GET_COROUTINE_WRAPPER_METHODDEF {"set_asyncgen_hooks", (PyCFunction)(void(*)(void))sys_set_asyncgen_hooks, METH_VARARGS | METH_KEYWORDS, set_asyncgen_hooks_doc}, SYS_GET_ASYNCGEN_HOOKS_METHODDEF |