Revert "Add more exception logging, fix some additional stream read/write issues"

This reverts commit f15a0bdc0b.
This commit is contained in:
Ian McEwen
2025-11-13 12:07:32 -07:00
parent f15a0bdc0b
commit dea5f788a2

View File

@@ -104,7 +104,7 @@ class StreamInterface(MeshInterface):
def _writeBytes(self, b: bytes) -> None:
"""Write an array of bytes to our stream and flush"""
if self.stream and self.stream is not None and getattr(self.stream, "is_open", False): # ignore writes when stream is closed
if self.stream: # ignore writes when stream is closed
self.stream.write(b)
self.stream.flush()
# win11 might need a bit more time, too
@@ -116,7 +116,7 @@ class StreamInterface(MeshInterface):
def _readBytes(self, length) -> Optional[bytes]:
"""Read an array of bytes from our stream"""
if self.stream and self.stream is not None and getattr(self.stream, "is_open", False):
if self.stream:
return self.stream.read(length)
else:
return None
@@ -226,12 +226,10 @@ class StreamInterface(MeshInterface):
logger.error(
f"Unexpected OSError, terminating meshtastic reader... {ex}"
)
traceback.print_exc()
except Exception as ex:
logger.error(
f"Unexpected exception, terminating meshtastic reader... {ex}"
)
traceback.print_exc()
finally:
logger.debug("reader is exiting")
self._disconnected()