howie6879 / ruia

Async Python 3.6+ web scraping micro-framework based on asyncio
https://www.howie6879.com/ruia/
Apache License 2.0
1.75k stars 181 forks source link

python3.9 remove asyncio.Task.all_tasks() #136

Closed happyli0826 closed 3 years ago

happyli0826 commented 3 years ago

python3.9 部分方法更改,可加入版本判断 spider.py

源函数 async def _cancel_tasks(self): tasks = [] for task in asyncio.Task.all_tasks(): if task is not asyncio.tasks.Task.current_task(): tasks.append(task) task.cancel() await asyncio.gather(*tasks, return_exceptions=True)

3.9修改后 async def _cancel_tasks(self): tasks = [] 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)

howie6879 commented 3 years ago

@happyli0826 感谢反馈

是不是你用的ruia版本不是最新的?最新版已经做了适配

happyli0826 commented 3 years ago

是的,版本是旧的,打扰了,不好意思

发自我的iPhone

在 2021年4月17日,14:05,howie.hu @.***> 写道:

 @happyli0826 感谢反馈

是不是你用的ruia版本不是最新的?最新版已经做了适配

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

howie6879 commented 3 years ago

不会啊,有任何问题欢迎反馈

happyli0826 @.***> 于2021年4月17日周六 下午2:15写道:

是的,版本是旧的,打扰了,不好意思

发自我的iPhone

在 2021年4月17日,14:05,howie.hu @.***> 写道:

 @happyli0826 感谢反馈

是不是你用的ruia版本不是最新的?最新版已经做了适配

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/howie6879/ruia/issues/136#issuecomment-821774641, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECB6XDEJMAQIYPYUX2SYZ3TJEROHANCNFSM43CXDJ5Q .