Skip to content

Commit 3beb5b5

Browse files
committed
fix Message's __eq__() and __ne__()
1 parent 517ca2a commit 3beb5b5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

can/message.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,13 @@ def __eq__(self, other):
144144
self.bitrate_switch == other.bitrate_switch
145145
)
146146
else:
147-
raise NotImplementedError()
147+
return NotImplemented
148148

149149
def __ne__(self, other):
150-
return not self.__eq__(other)
150+
if isinstance(other, self.__class__):
151+
return not self.__eq__(other)
152+
else:
153+
return NotImplemented
151154

152155
def __hash__(self):
153156
return hash((

0 commit comments

Comments
 (0)