Commit 1b6991e2 authored by Seth Sims's avatar Seth Sims
Browse files

WebSocket.send_bytes is a coroutine as of aiohttp 3.0 changing transport.write...

WebSocket.send_bytes is a coroutine as of aiohttp 3.0 changing transport.write to await the coroutine if necessary.
parent 0bd35d3c
import asyncio
import aiohttp
from gremlin_python.driver import transport
......@@ -18,8 +19,10 @@ class AiohttpTransport(transport.AbstractBaseTransport):
self._ws = await self._client_session.ws_connect(url)
self._connected = True
def write(self, message):
self._ws.send_bytes(message)
async def write(self, message):
coro = self._ws.send_bytes(message)
if asyncio.iscoroutine(coro):
await coro
async def read(self):
data = await self._ws.receive()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment