Mes*_*ssa 6 python python-asyncio
我有这个代码:
done, pending = asyncio.wait(
[a, b],
return_when=asyncio.FIRST_COMPLETED)
Run Code Online (Sandbox Code Playgroud)
但它失败了:
Traceback (most recent call last):
...
File "/.../api.py", line 83, in websockets_handler
return_when=asyncio.FIRST_COMPLETED)
TypeError: cannot unpack non-iterable coroutine object
Run Code Online (Sandbox Code Playgroud)
Mes*_*ssa 13
嗯,await前面应该有asyncio.wait:)
done, pending = await asyncio.wait(
[a, b],
return_when=asyncio.FIRST_COMPLETED)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5069 次 |
| 最近记录: |