From 096fec95c8327c91a21ce7a598ea7c909dc5a6f1 Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Thu, 13 Nov 2025 12:07:48 -0700 Subject: [PATCH] Revert "Wrap double-close in a try-catch. Slightly ugly but oh well." This reverts commit dbc0101a7a4c97efbdd9efab9178d8e24f03a5b2. --- meshtastic/stream_interface.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/meshtastic/stream_interface.py b/meshtastic/stream_interface.py index 82b6ab5..06ee28a 100644 --- a/meshtastic/stream_interface.py +++ b/meshtastic/stream_interface.py @@ -93,12 +93,9 @@ class StreamInterface(MeshInterface): logger.debug("Closing our port") # pylint: disable=E0203 - if hasattr(self, "stream") and self.stream is not None and getattr(self.stream, "is_open", False): + if not self.stream is None: # pylint: disable=E0203 - try: - self.stream.close() - except Exception as e: - logger.debug(f"Exception during close: {e}") + self.stream.close() # pylint: disable=W0201 self.stream = None