gpt4 book ai didi

python - asyncio.await失败,并出现TypeError : cannot unpack non-iterable coroutine object

转载 作者:行者123 更新时间:2023-12-03 13:48:22 102 4
gpt4 key购买 nike

我有以下代码:

done, pending = asyncio.wait(
[a, b],
return_when=asyncio.FIRST_COMPLETED)

但是失败了:
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

最佳答案

好吧,在await前面应该有asyncio.wait :)

done, pending = await asyncio.wait(
[a, b],
return_when=asyncio.FIRST_COMPLETED)

关于python - asyncio.await失败,并出现TypeError : cannot unpack non-iterable coroutine object,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51527364/

102 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com