瀏覽代碼

Use the Future's result directly rather than awaiting again

The asyncio documentation does not specify whether awaiting a Future multiple times is supported or not: https://bugs.python.org/issue41275
master
JustAnotherArchivist 3 年之前
父節點
當前提交
749158b97a
共有 1 個檔案被更改,包括 1 行新增2 行删除
  1. +1
    -2
      qwarc/__init__.py

+ 1
- 2
qwarc/__init__.py 查看文件

@@ -248,9 +248,8 @@ class QWARC:
self._sleepTasks.remove(future)
elif future.taskType == 'process':
item = future.item
# TODO Replace all of this with `if future.cancelled():`
try:
await future #TODO: Is this actually necessary? asyncio.wait only returns 'done' futures...
future.result()
except concurrent.futures.CancelledError as e:
# Got cancelled, nothing we can do about it, but let's log a warning if it's a process task
if future.taskType == 'process':


Loading…
取消
儲存