Skip to content

Commit c4f2b92

Browse files
author
Pratik Mahamuni
committed
Based on how the data is being sent to various tests and 'equals' method in the Message class, modified the equal method to make sure that the data being read is equal to the DLC. This is a temporary fix till we agree on what data should be used in the tests, especially pertaining to the BLFReader / BLFWriter constructors
1 parent 8966e38 commit c4f2b92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

can/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def equals(
321321
and self.arbitration_id == other.arbitration_id
322322
and self.is_extended_id == other.is_extended_id
323323
and self.dlc == other.dlc
324-
and self.data == other.data
324+
and self.data[: self.dlc] == other.data[: other.dlc]
325325
and self.is_remote_frame == other.is_remote_frame
326326
and self.is_error_frame == other.is_error_frame
327327
and (self.channel == other.channel or not check_channel)

0 commit comments

Comments
 (0)