Skip to content
Snippets Groups Projects
Commit 3e5381ee authored by Seth Sims's avatar Seth Sims
Browse files

aiohttp 3 dropped the tp alias for type in WSMessage, changing to its full name

parent 1b6991e2
No related branches found
No related tags found
No related merge requests found
......@@ -26,16 +26,16 @@ class AiohttpTransport(transport.AbstractBaseTransport):
async def read(self):
data = await self._ws.receive()
if data.tp == aiohttp.WSMsgType.close:
if data.type == aiohttp.WSMsgType.close:
await self._transport.close()
raise RuntimeError("Connection closed by server")
elif data.tp == aiohttp.WSMsgType.error:
elif data.type == aiohttp.WSMsgType.error:
# This won't raise properly, fix
raise data.data
elif data.tp == aiohttp.WSMsgType.closed:
elif data.type == aiohttp.WSMsgType.closed:
# Hmm
raise RuntimeError("Connection closed by server")
elif data.tp == aiohttp.WSMsgType.text:
elif data.type == aiohttp.WSMsgType.text:
# Should return bytes
data = data.data.strip().encode('utf-8')
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment