You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.11 incompatible with websockets\legacy\protocol.py
Error "got an unexpected keyword argument 'loop'"
The following places is where this happens, fix is simply remove 'loop' argument.
WebSocketCommonProtocol.init
FROM:
self._drain_lock = asyncio.Lock(
loop=loop if sys.version_info[:2] < (3, 8) else None
)
TO:
self._drain_lock = asyncio.Lock()
Python 3.11 incompatible with websockets\legacy\protocol.py
Error "got an unexpected keyword argument 'loop'"
The following places is where this happens, fix is simply remove 'loop' argument.
WebSocketCommonProtocol.init
FROM:
self._drain_lock = asyncio.Lock(
loop=loop if sys.version_info[:2] < (3, 8) else None
)
TO:
self._drain_lock = asyncio.Lock()
WebSocketCommonProtocol.close
FROM:
await asyncio.wait_for(
self.write_close_frame(serialize_close(code, reason)),
self.close_timeout,
loop=self.loop if sys.version_info[:2] < (3, 8) else None,
)
TO:
await asyncio.wait_for(
self.write_close_frame(serialize_close(code, reason)),
self.close_timeout
)
WebSocketCommonProtocol.wait_for_connection_lost
FROM:
await asyncio.wait_for(
asyncio.shield(self.connection_lost_waiter),
self.close_timeout,
loop=self.loop if sys.version_info[:2] < (3, 8) else None,
)
TO:
await asyncio.wait_for(
asyncio.shield(self.connection_lost_waiter),
self.close_timeout,
)
WebSocketCommonProtocol.recv
FROM:
await asyncio.wait(
[pop_message_waiter, self.transfer_data_task],
loop=self.loop if sys.version_info[:2] < (3, 8) else None,
return_when=asyncio.FIRST_COMPLETED,
)
TO:
await asyncio.wait(
[pop_message_waiter, self.transfer_data_task],
return_when=asyncio.FIRST_COMPLETED,
)
WebSocketCommonProtocol.keepalive_ping
FROM:
await asyncio.sleep(
self.ping_interval,
loop=self.loop if sys.version_info[:2] < (3, 8) else None,
)
await asyncio.wait_for(
pong_waiter,
self.ping_timeout,
loop=self.loop if sys.version_info[:2] < (3, 8) else None,
)
TO:
await asyncio.sleep(
self.ping_interval
)
await asyncio.wait_for(
pong_waiter,
self.ping_timeout
)
The text was updated successfully, but these errors were encountered: