From 4996b4ff73a1beb6f5753b6006ab6e7498aae08e Mon Sep 17 00:00:00 2001 From: Olivier Date: Wed, 3 Jul 2024 09:13:28 +0200 Subject: [PATCH] fix typing of new error callback --- asyncua/client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asyncua/client/client.py b/asyncua/client/client.py index 3e7ccb750..e8cf1d664 100644 --- a/asyncua/client/client.py +++ b/asyncua/client/client.py @@ -72,7 +72,7 @@ def __init__(self, url: str, timeout: float = 4, watchdog_intervall: float = 1.0 self.secure_channel_id = None self.secure_channel_timeout = 3600000 # 1 hour self.session_timeout = 3600000 # 1 hour - self.connection_lost_callback: Optional[Callable[[Exception], None]] = None + self.connection_lost_callback: Optional[Callable[[Exception], Coroutine[Any, Any, None]]] = None self._policy_ids: List[ua.UserTokenPolicy] = [] self.uaclient: UaClient = UaClient(timeout) self.uaclient.pre_request_hook = self.check_connection @@ -561,7 +561,7 @@ async def _monitor_server_loop(self): await self.uaclient.inform_subscriptions(ua.StatusCode(ua.StatusCodes.BadShutdown)) raise - async def _lost_connection(self, ex: BaseException): + async def _lost_connection(self, ex: Exception): if not self.connection_lost_callback: return try: