mirror of
https://github.com/meshtastic/python.git
synced 2026-01-03 21:37:57 -05:00
Revert "Add more exception logging, fix some additional stream read/write issues"
This reverts commit f15a0bdc0b.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user