From d0b4fe3fc6cc3eee8c028fc458ed369a2209f177 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 12 Jan 2024 16:17:53 -1000 Subject: [PATCH] handle cancellation --- kasa/protocol.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kasa/protocol.py b/kasa/protocol.py index 23c8edae..c4902b09 100755 --- a/kasa/protocol.py +++ b/kasa/protocol.py @@ -153,6 +153,7 @@ class TPLinkSmartHomeProtocol: continue except BaseException as ex: # Likely something cancelled the task so we need to close the connection + # as we are not in an indeterminate state self.close_without_wait() _LOGGER.debug( "%s: BaseException during connect, closing connection: %s", @@ -179,6 +180,7 @@ class TPLinkSmartHomeProtocol: ) except BaseException as ex: # Likely something cancelled the task so we need to close the connection + # as we are not in an indeterminate state self.close_without_wait() _LOGGER.debug( "%s: BaseException during query, closing connection: %s",