Skip to content

Commit 3291110

Browse files
authored
Implement equality operator for SdoAbortedError. (#424)
1 parent dc8a4ca commit 3291110

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

canopen/sdo/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ def __str__(self):
5454
text = text + ", " + self.CODES[self.code]
5555
return text
5656

57+
def __eq__(self, other):
58+
"""Compare two exception objects based on SDO abort code."""
59+
return self.code == other.code
60+
5761

5862
class SdoCommunicationError(SdoError):
5963
"""No or unexpected response from slave."""

0 commit comments

Comments
 (0)