fix context managers
This commit is contained in:
parent
eda0dc8193
commit
d8ab7c1d9b
2 changed files with 4 additions and 4 deletions
|
@ -22,8 +22,8 @@ class AlertmanagerClient(AsyncContextManager):
|
|||
self.cache = cache
|
||||
self.session = aiohttp.ClientSession()
|
||||
|
||||
def __aenter__(self) -> AlertmanagerClient:
|
||||
return self
|
||||
async def __aenter__(self) -> AlertmanagerClient:
|
||||
return await self
|
||||
|
||||
async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
|
||||
await super().__aexit__(*args, **kwargs)
|
||||
|
|
|
@ -65,8 +65,8 @@ class Webhook(AsyncContextManager):
|
|||
self.port = config.port
|
||||
self.socket = config.socket
|
||||
|
||||
def __aenter__(self) -> Webhook:
|
||||
return self
|
||||
async def __aenter__(self) -> Webhook:
|
||||
return await self
|
||||
|
||||
async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
|
||||
await super().__aexit__(*args, **kwargs)
|
||||
|
|
Loading…
Reference in a new issue