From 6bf68ed354affb97e461bff24d7b6d15e8da5172 Mon Sep 17 00:00:00 2001 From: trojvn Date: Fri, 7 Feb 2025 12:48:44 +0300 Subject: [PATCH] disconnect if error --- basethon/base_thon.py | 1 + 1 file changed, 1 insertion(+) diff --git a/basethon/base_thon.py b/basethon/base_thon.py index 768353f..bdfb763 100644 --- a/basethon/base_thon.py +++ b/basethon/base_thon.py @@ -176,6 +176,7 @@ class BaseThon(BaseData): async def __aenter__(self) -> str | Self: r = await self.check() if r != "OK": + await self.disconnect() return r return self