From 7a7c4b4d629fb847026ba27d0d920df65472953a Mon Sep 17 00:00:00 2001 From: Nadir Chowdhury Date: Tue, 6 Apr 2021 01:29:37 +0100 Subject: [PATCH] Remove fail-safe for retrieving all tasks --- discord/client.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/discord/client.py b/discord/client.py index 8105c8ec5..ffa528315 100644 --- a/discord/client.py +++ b/discord/client.py @@ -55,13 +55,7 @@ from .appinfo import AppInfo log = logging.getLogger(__name__) def _cancel_tasks(loop): - try: - task_retriever = asyncio.Task.all_tasks - except AttributeError: - # future proofing for 3.9 I guess - task_retriever = asyncio.all_tasks - - tasks = {t for t in task_retriever(loop=loop) if not t.done()} + tasks = {t for t in asyncio.all_tasks(loop=loop) if not t.done()} if not tasks: return