未验证 提交 c00ae6cb 编写于 作者: 李玺 提交者: GitHub

修复all_tasks问题

上级 56a1e2f5
......@@ -203,8 +203,8 @@ class Spider(SpiderHook):
async def _cancel_tasks(self):
tasks = []
for task in asyncio.Task.all_tasks():
if task is not asyncio.tasks.Task.current_task():
for task in asyncio.all_tasks():
if task is not asyncio.current_task():
tasks.append(task)
task.cancel()
await asyncio.gather(*tasks, return_exceptions=True)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册