Skip to content

Commit

Permalink
Implement equality operator for SdoAbortedError. (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
acolomb committed Apr 28, 2024
1 parent dc8a4ca commit 3291110
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions canopen/sdo/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def __str__(self):
text = text + ", " + self.CODES[self.code]
return text

def __eq__(self, other):
"""Compare two exception objects based on SDO abort code."""
return self.code == other.code


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

0 comments on commit 3291110

Please sign in to comment.