From d5216e6277480baecaf0a0d68acfff045f0ba8d6 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Wed, 30 Aug 2023 00:36:26 +0300 Subject: [PATCH] Lint nits --- pycyphal/transport/can/_session/_output.py | 2 +- pycyphal/transport/can/media/socketcan/_socketcan.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pycyphal/transport/can/_session/_output.py b/pycyphal/transport/can/_session/_output.py index 2b63f91d0..0f512799c 100644 --- a/pycyphal/transport/can/_session/_output.py +++ b/pycyphal/transport/can/_session/_output.py @@ -48,7 +48,7 @@ class _PendingFeedbackKey: # noinspection PyAbstractClass -class CANOutputSession(CANSession, pycyphal.transport.OutputSession): +class CANOutputSession(CANSession, pycyphal.transport.OutputSession): # pylint: disable=abstract-method """ This is actually an abstract class, but its concrete inheritors are hidden from the API. The implementation is chosen according to the type of the session requested: broadcast or unicast. diff --git a/pycyphal/transport/can/media/socketcan/_socketcan.py b/pycyphal/transport/can/media/socketcan/_socketcan.py index fb2400618..6ecdf2ba7 100644 --- a/pycyphal/transport/can/media/socketcan/_socketcan.py +++ b/pycyphal/transport/can/media/socketcan/_socketcan.py @@ -141,6 +141,8 @@ async def send(self, frames: typing.Iterable[Envelope], monotonic_deadline: floa loop.sock_sendall(self._sock, self._compile_native_frame(f.frame)), timeout=monotonic_deadline - loop.time(), ) + except asyncio.TimeoutError: + break except OSError as err: if self._closed: # https://github.com/OpenCyphal/pycyphal/issues/204 break @@ -152,8 +154,6 @@ async def send(self, frames: typing.Iterable[Envelope], monotonic_deadline: floa ) from err self._closed = self._closed or err.errno in self._errno_unrecoverable raise err - except asyncio.TimeoutError: - break else: num_sent += 1 return num_sent