diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-07-01 21:06:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-01 21:06:51 -0700 |
| commit | df59293bf0d815fe37743025d639a63a78e0c771 (patch) | |
| tree | c5620f0b8d6d04860852303d822dfb6551733651 /Lib/asyncio/tasks.py | |
| parent | fe0175f5b50967aae90cb759a0d2d016fb745584 (diff) | |
| download | cpython-git-df59293bf0d815fe37743025d639a63a78e0c771.tar.gz | |
bpo-40967: Remove deprecated asyncio.Task.current_task() and asyncio.Task.all_tasks() (GH-20874)
(cherry picked from commit 004e64e8059fe68a72890314673282f2e60d5ce1)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
Diffstat (limited to 'Lib/asyncio/tasks.py')
| -rw-r--r-- | Lib/asyncio/tasks.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index 21b98b6647..5e0692ef77 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -113,34 +113,6 @@ class Task(futures._PyFuture): # Inherit Python Task implementation # status is still pending _log_destroy_pending = True - @classmethod - def current_task(cls, loop=None): - """Return the currently running task in an event loop or None. - - By default the current task for the current event loop is returned. - - None is returned when called not in the context of a Task. - """ - warnings.warn("Task.current_task() is deprecated since Python 3.7, " - "use asyncio.current_task() instead", - DeprecationWarning, - stacklevel=2) - if loop is None: - loop = events.get_event_loop() - return current_task(loop) - - @classmethod - def all_tasks(cls, loop=None): - """Return a set of all tasks for an event loop. - - By default all tasks for the current event loop are returned. - """ - warnings.warn("Task.all_tasks() is deprecated since Python 3.7, " - "use asyncio.all_tasks() instead", - DeprecationWarning, - stacklevel=2) - return _all_tasks_compat(loop) - def __init__(self, coro, *, loop=None, name=None): super().__init__(loop=loop) if self._source_traceback: |
