fix bug
This commit is contained in:
parent
41bdbc8e37
commit
6fb440c842
|
@ -1,5 +1,4 @@
|
|||
import asyncio
|
||||
from contextlib import suppress
|
||||
import os
|
||||
from typing import Optional
|
||||
|
||||
|
@ -67,12 +66,18 @@ class ClientSession:
|
|||
return api
|
||||
|
||||
async def __aexit__(self, *args):
|
||||
with suppress(Exception):
|
||||
try:
|
||||
self.writer.close()
|
||||
await self.writer.wait_closed()
|
||||
with suppress(Exception):
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.tasks[0].cancel()
|
||||
await self.tasks[0]
|
||||
with suppress(Exception):
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.tasks[1].cancel()
|
||||
await self.tasks[1]
|
||||
except:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue