From 2ff49cea0b4761722e64a834e21fb72093367b5a Mon Sep 17 00:00:00 2001 From: jan iversen Date: Sat, 20 Jul 2024 10:37:47 +0200 Subject: [PATCH] try. --- pymodbus/transport/serialtransport.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pymodbus/transport/serialtransport.py b/pymodbus/transport/serialtransport.py index c014b696a6..1c8634c2ee 100644 --- a/pymodbus/transport/serialtransport.py +++ b/pymodbus/transport/serialtransport.py @@ -12,7 +12,7 @@ class SerialTransport(asyncio.Transport): """An asyncio serial transport.""" - force_poll: bool = False + force_poll: bool def __init__(self, loop, protocol, url, baudrate, bytesize, parity, stopbits, timeout) -> None: """Initialize.""" @@ -36,9 +36,9 @@ def setup(self) -> None: else: try: self.async_loop.add_reader(self.sync_serial.fileno(), self.intern_read_ready) - except Exception as exc: # pylint: disable=broad-exception-caught + except Exception as exc: text = f"JAN setup --> os.name({os.name}) and {exc} force({self.force_poll})" - raise Exception(text) + raise Exception(text) # pylint: disable=raise-missing-from,broad-exception-raised self.async_loop.call_soon(self.intern_protocol.connection_made, self) @@ -66,9 +66,9 @@ def write(self, data) -> None: if not self.force_poll: try: self.async_loop.add_writer(self.sync_serial.fileno(), self.intern_write_ready) - except Exception as exc: # pylint: disable=broad-exception-caught + except Exception as exc: text = f"JAN write --> os.name({os.name}) and {exc} force({self.force_poll})" - raise Exception(text) + raise Exception(text) # pylint: disable=raise-missing-from,broad-exception-raised def flush(self) -> None: """Clear output buffer and stops any more data being written."""