Skip to content

Commit 6811f92

Browse files
committed
make pylint happy
1 parent e112874 commit 6811f92

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

can/interfaces/socketcan/socketcan.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@
4141
log.error("socket.CMSG_SPACE not available on this platform")
4242

4343

44+
# Constants needed for precise handling of timestamps
45+
RECEIVED_TIMESTAMP_STRUCT = struct.Struct("@ll")
46+
RECEIVED_ANCILLARY_BUFFER_SIZE = (
47+
CMSG_SPACE(RECEIVED_TIMESTAMP_STRUCT.size) if CMSG_SPACE_available else 0
48+
)
49+
50+
4451
# Setup BCM struct
4552
def bcm_header_factory(
4653
fields: List[Tuple[str, Union[Type[ctypes.c_uint32], Type[ctypes.c_long]]]],
@@ -597,12 +604,6 @@ def capture_message(
597604
return msg
598605

599606

600-
# Constants needed for precise handling of timestamps
601-
if CMSG_SPACE_available:
602-
RECEIVED_TIMESTAMP_STRUCT = struct.Struct("@ll")
603-
RECEIVED_ANCILLARY_BUFFER_SIZE = CMSG_SPACE(RECEIVED_TIMESTAMP_STRUCT.size)
604-
605-
606607
class SocketcanBus(BusABC): # pylint: disable=abstract-method
607608
"""A SocketCAN interface to CAN.
608609

0 commit comments

Comments
 (0)