session close is async, fix annoying error message

This commit is contained in:
Victor Shyba 2020-09-02 18:49:41 -03:00
parent 7c5211d420
commit bc678f2146

View file

@ -3493,8 +3493,8 @@ class Client(API):
self.ws = await self.session.ws_connect(self.url) self.ws = await self.session.ws_connect(self.url)
self.receive_messages_task = asyncio.create_task(self.receive_messages()) self.receive_messages_task = asyncio.create_task(self.receive_messages())
def disconnect(self): async def disconnect(self):
self.session.close() await self.session.close()
self.receive_messages_task.cancel() self.receive_messages_task.cancel()
async def receive_messages(self): async def receive_messages(self):