Closed yjqiang closed 6 years ago
try: self.ws = await websockets.connect('wss://broadcastlv.chat.bilibili.com/sub', timeout=3) except: print("# 连接无法建立,请检查本地网络状况") print(sys.exc_info()[0], sys.exc_info()[1]) return False
It works well in python 3.6, while crash in python 3.7.
Could you print the python backtrace here ? Thanks
<class 'TypeError'> cannot 'yield from' a coroutine object in a non-coroutine generaorator.
(The code I showed before)RuntimeWarning: coroutine "BaseEventLoop.create_ connection" was never awaited.
That is all it shows to me. But you can run the code I gave, and print more information.
You're hiding the backtrace, please remove the try
/except
and let the full backtrace print on screen, and copy paste that. Thanks
Traceback (most recent call last):
File "0.py(1).py", line 15, in
Dupe of #405 then. 3.7 is supported on master - which I encourage you to test - and the next release will include the necessary changes. Closing. Thanks
I noticed that once, but couldn't find in a short time, so I thought it is the feature for python3.8. LOL. Anyway thanks a lot.
Version 6.0 adds support for Python 3.7 and is now available on PyPI: https://pypi.org/project/websockets/6.0/#files
cannot 'yield from' a coroutine object in a non-coroutine generaorator.
RuntimeWarning: coroutine "BaseEventLoop.create_ connection" was never awaited.