Skip to content

Commit 4feb261

Browse files
fix pylint issues
1 parent 3013dd5 commit 4feb261

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

can/interfaces/socketcan/socketcan.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ def build_can_frame(msg: Message) -> bytes:
242242
data_len = msg.dlc
243243
else:
244244
data_len = min(i for i in can.util.CAN_FD_DLC if i >= len(msg.data))
245+
header = CAN_FRAME_HEADER_STRUCT.pack(can_id, data_len, flags, msg.dlc)
246+
return header + data
245247

246248

247249
def build_bcm_header(
@@ -330,8 +332,7 @@ def dissect_can_frame(frame: bytes) -> Tuple[int, int, int, bytes]:
330332
# Allow deprecated can frames with old struct
331333
if (
332334
data_len == constants.CAN_MAX_DLEN
333-
and len8_dlc > constants.CAN_MAX_DLEN
334-
and len8_dlc <= constants.CAN_MAX_RAW_DLC
335+
and constants.CAN_MAX_DLEN < len8_dlc <= constants.CAN_MAX_RAW_DLC
335336
):
336337
can_dlc = len8_dlc
337338
else:

0 commit comments

Comments
 (0)