Skip to content

Commit cfa4b99

Browse files
committed
Also remove get_coroutine_wrapper
1 parent e116aa6 commit cfa4b99

File tree

6 files changed

+2
-52
lines changed

6 files changed

+2
-52
lines changed

Doc/library/sys.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -777,22 +777,6 @@ always available.
777777
for details.) Use it only for debugging purposes.
778778

779779

780-
.. function:: get_coroutine_wrapper()
781-
782-
Returns ``None``, or a wrapper set by :func:`set_coroutine_wrapper`.
783-
784-
.. versionadded:: 3.5
785-
See :pep:`492` for more details.
786-
787-
.. note::
788-
This function has been added on a provisional basis (see :pep:`411`
789-
for details.) Use it only for debugging purposes.
790-
791-
.. deprecated:: 3.7
792-
The coroutine wrapper functionality has been deprecated, and
793-
will be removed in 3.8. See :issue:`32591` for details.
794-
795-
796780
.. data:: hash_info
797781

798782
A :term:`struct sequence` giving parameters of the numeric hash

Include/ceval.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
3333
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
3434
PyAPI_FUNC(void) _PyEval_SetCoroutineOriginTrackingDepth(int new_depth);
3535
PyAPI_FUNC(int) _PyEval_GetCoroutineOriginTrackingDepth(void);
36-
PyAPI_FUNC(PyObject *) _PyEval_GetCoroutineWrapper(void);
3736
PyAPI_FUNC(void) _PyEval_SetAsyncGenFirstiter(PyObject *);
3837
PyAPI_FUNC(PyObject *) _PyEval_GetAsyncGenFirstiter(void);
3938
PyAPI_FUNC(void) _PyEval_SetAsyncGenFinalizer(PyObject *);

Lib/test/test_coroutines.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,13 +2146,6 @@ async def f():
21462146
self.assertEqual(buffer, [1, 2, 'MyException'])
21472147

21482148

2149-
class SysGetCoroWrapperTest(unittest.TestCase):
2150-
2151-
def test_get_wrapper_1(self):
2152-
with self.assertWarns(DeprecationWarning):
2153-
self.assertIsNone(sys.get_coroutine_wrapper())
2154-
2155-
21562149
class OriginTrackingTest(unittest.TestCase):
21572150
def here(self):
21582151
info = inspect.getframeinfo(inspect.currentframe().f_back)
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
The function ``sys.set_coroutine_wrapper`` that was deprecated and marked
2-
for removal in 3.8 has been removed. ``sys.get_coroutine_wrapper`` now
3-
always return ``None``.
1+
The functions ``sys.set_coroutine_wrapper`` and ``sys.get_coroutine_wrapper``
2+
that were deprecated and marked for removal in 3.8 have been removed.

Python/ceval.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4614,12 +4614,6 @@ _PyEval_GetCoroutineOriginTrackingDepth(void)
46144614
return tstate->coroutine_origin_tracking_depth;
46154615
}
46164616

4617-
PyObject *
4618-
_PyEval_GetCoroutineWrapper(void)
4619-
{
4620-
return NULL;
4621-
}
4622-
46234617
void
46244618
_PyEval_SetAsyncGenFirstiter(PyObject *firstiter)
46254619
{

Python/sysmodule.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,24 +1158,6 @@ sys_get_coroutine_origin_tracking_depth_impl(PyObject *module)
11581158
return _PyEval_GetCoroutineOriginTrackingDepth();
11591159
}
11601160

1161-
/*[clinic input]
1162-
sys.get_coroutine_wrapper
1163-
1164-
Return the wrapper for coroutines set by sys.set_coroutine_wrapper.
1165-
[clinic start generated code]*/
1166-
1167-
static PyObject *
1168-
sys_get_coroutine_wrapper_impl(PyObject *module)
1169-
/*[clinic end generated code: output=b74a7e4b14fe898e input=ef0351fb9ece0bb4]*/
1170-
{
1171-
if (PyErr_WarnEx(PyExc_DeprecationWarning,
1172-
"get_coroutine_wrapper is deprecated", 1) < 0) {
1173-
return NULL;
1174-
}
1175-
Py_RETURN_NONE;
1176-
}
1177-
1178-
11791161
static PyTypeObject AsyncGenHooksType;
11801162

11811163
PyDoc_STRVAR(asyncgen_hooks_doc,
@@ -1964,7 +1946,6 @@ static PyMethodDef sys_methods[] = {
19641946
SYS__DEBUGMALLOCSTATS_METHODDEF
19651947
SYS_SET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF
19661948
SYS_GET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF
1967-
SYS_GET_COROUTINE_WRAPPER_METHODDEF
19681949
{"set_asyncgen_hooks", (PyCFunction)(void(*)(void))sys_set_asyncgen_hooks,
19691950
METH_VARARGS | METH_KEYWORDS, set_asyncgen_hooks_doc},
19701951
SYS_GET_ASYNCGEN_HOOKS_METHODDEF

0 commit comments

Comments
 (0)