Skip to content

Commit

Permalink
fix pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cymotive-eldad-sitbon committed Sep 8, 2024
1 parent 3013dd5 commit 4feb261
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions can/interfaces/socketcan/socketcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ def build_can_frame(msg: Message) -> bytes:
data_len = msg.dlc
else:
data_len = min(i for i in can.util.CAN_FD_DLC if i >= len(msg.data))
header = CAN_FRAME_HEADER_STRUCT.pack(can_id, data_len, flags, msg.dlc)
return header + data


def build_bcm_header(
Expand Down Expand Up @@ -330,8 +332,7 @@ def dissect_can_frame(frame: bytes) -> Tuple[int, int, int, bytes]:
# Allow deprecated can frames with old struct
if (
data_len == constants.CAN_MAX_DLEN
and len8_dlc > constants.CAN_MAX_DLEN
and len8_dlc <= constants.CAN_MAX_RAW_DLC
and constants.CAN_MAX_DLEN < len8_dlc <= constants.CAN_MAX_RAW_DLC
):
can_dlc = len8_dlc
else:
Expand Down

0 comments on commit 4feb261

Please sign in to comment.