diff options
author | RĂ©mi Lapeyre <remi.lapeyre@lenstra.fr> | 2020-07-02 03:41:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-02 03:41:21 (GMT) |
commit | 004e64e8059fe68a72890314673282f2e60d5ce1 (patch) | |
tree | 02729d1a0324f5ccfbdea2d667cc2ec348c5a156 /Modules/clinic | |
parent | 666ecfb0957a2fa0df5e2bd03804195de74bdfbf (diff) | |
download | cpython-004e64e8059fe68a72890314673282f2e60d5ce1.zip cpython-004e64e8059fe68a72890314673282f2e60d5ce1.tar.gz cpython-004e64e8059fe68a72890314673282f2e60d5ce1.tar.bz2 |
bpo-40967: Remove deprecated asyncio.Task.current_task() and asyncio.Task.all_tasks() (GH-20874)
Diffstat (limited to 'Modules/clinic')
-rw-r--r-- | Modules/clinic/_asynciomodule.c.h | 82 |
1 files changed, 1 insertions, 81 deletions
diff --git a/Modules/clinic/_asynciomodule.c.h b/Modules/clinic/_asynciomodule.c.h index d3e59a4..a071efc 100644 --- a/Modules/clinic/_asynciomodule.c.h +++ b/Modules/clinic/_asynciomodule.c.h @@ -355,86 +355,6 @@ exit: return return_value; } -PyDoc_STRVAR(_asyncio_Task_current_task__doc__, -"current_task($type, /, loop=None)\n" -"--\n" -"\n" -"Return the currently running task in an event loop or None.\n" -"\n" -"By default the current task for the current event loop is returned.\n" -"\n" -"None is returned when called not in the context of a Task."); - -#define _ASYNCIO_TASK_CURRENT_TASK_METHODDEF \ - {"current_task", (PyCFunction)(void(*)(void))_asyncio_Task_current_task, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, _asyncio_Task_current_task__doc__}, - -static PyObject * -_asyncio_Task_current_task_impl(PyTypeObject *type, PyObject *loop); - -static PyObject * -_asyncio_Task_current_task(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) -{ - PyObject *return_value = NULL; - static const char * const _keywords[] = {"loop", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "current_task", 0}; - PyObject *argsbuf[1]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; - PyObject *loop = Py_None; - - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf); - if (!args) { - goto exit; - } - if (!noptargs) { - goto skip_optional_pos; - } - loop = args[0]; -skip_optional_pos: - return_value = _asyncio_Task_current_task_impl(type, loop); - -exit: - return return_value; -} - -PyDoc_STRVAR(_asyncio_Task_all_tasks__doc__, -"all_tasks($type, /, loop=None)\n" -"--\n" -"\n" -"Return a set of all tasks for an event loop.\n" -"\n" -"By default all tasks for the current event loop are returned."); - -#define _ASYNCIO_TASK_ALL_TASKS_METHODDEF \ - {"all_tasks", (PyCFunction)(void(*)(void))_asyncio_Task_all_tasks, METH_FASTCALL|METH_KEYWORDS|METH_CLASS, _asyncio_Task_all_tasks__doc__}, - -static PyObject * -_asyncio_Task_all_tasks_impl(PyTypeObject *type, PyObject *loop); - -static PyObject * -_asyncio_Task_all_tasks(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) -{ - PyObject *return_value = NULL; - static const char * const _keywords[] = {"loop", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "all_tasks", 0}; - PyObject *argsbuf[1]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; - PyObject *loop = Py_None; - - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf); - if (!args) { - goto exit; - } - if (!noptargs) { - goto skip_optional_pos; - } - loop = args[0]; -skip_optional_pos: - return_value = _asyncio_Task_all_tasks_impl(type, loop); - -exit: - return return_value; -} - PyDoc_STRVAR(_asyncio_Task__make_cancelled_error__doc__, "_make_cancelled_error($self, /)\n" "--\n" @@ -912,4 +832,4 @@ _asyncio__leave_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=0e5c1eb8b692977b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d0fc522bcbff9d61 input=a9049054013a1b77]*/ |