Remove fail-safe for retrieving all tasks

This commit is contained in:
Nadir Chowdhury 2021-04-06 01:29:37 +01:00 committed by GitHub
parent 83bd76504a
commit 7a7c4b4d62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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