X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/2189bcaac01d9b6289411a75557a23cf4a06b783..eedfc3832290b3a32825b3c0f2dfa3f3d7ee9d1c:/src/black/concurrency.py diff --git a/src/black/concurrency.py b/src/black/concurrency.py index 10e288f..1598f51 100644 --- a/src/black/concurrency.py +++ b/src/black/concurrency.py @@ -47,12 +47,8 @@ def cancel(tasks: Iterable["asyncio.Task[Any]"]) -> None: def shutdown(loop: asyncio.AbstractEventLoop) -> None: """Cancel all pending tasks on `loop`, wait for them, and close the loop.""" try: - if sys.version_info[:2] >= (3, 7): - all_tasks = asyncio.all_tasks - else: - all_tasks = asyncio.Task.all_tasks # This part is borrowed from asyncio/runners.py in Python 3.7b2. - to_cancel = [task for task in all_tasks(loop) if not task.done()] + to_cancel = [task for task in asyncio.all_tasks(loop) if not task.done()] if not to_cancel: return