From ddf22f3694bcc7c6c397f80cfbda6540db90975d Mon Sep 17 00:00:00 2001 From: HgO Date: Fri, 8 Jul 2022 22:39:40 +0200 Subject: [PATCH] fix context managers --- matrix_alertbot/alertmanager.py | 2 +- matrix_alertbot/webhook.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix_alertbot/alertmanager.py b/matrix_alertbot/alertmanager.py index e79db57..a8e1ec3 100644 --- a/matrix_alertbot/alertmanager.py +++ b/matrix_alertbot/alertmanager.py @@ -23,7 +23,7 @@ class AlertmanagerClient(AsyncContextManager): self.session = aiohttp.ClientSession() async def __aenter__(self) -> AlertmanagerClient: - return await self + return self async def __aexit__(self, *args: Any, **kwargs: Any) -> None: await super().__aexit__(*args, **kwargs) diff --git a/matrix_alertbot/webhook.py b/matrix_alertbot/webhook.py index 5769d67..5a90b22 100644 --- a/matrix_alertbot/webhook.py +++ b/matrix_alertbot/webhook.py @@ -66,7 +66,7 @@ class Webhook(AsyncContextManager): self.socket = config.socket async def __aenter__(self) -> Webhook: - return await self + return self async def __aexit__(self, *args: Any, **kwargs: Any) -> None: await super().__aexit__(*args, **kwargs)