mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-08 21:17:47 +03:00
test: introduce __eq__() and __ne__()
Suggested by CodeQL#160 (https://github.com/systemd/systemd/security/code-scanning/160).
This commit is contained in:
parent
f9d1709c03
commit
74522aa87f
@ -100,6 +100,12 @@ class SD(object):
|
||||
def __cmp__(self, other):
|
||||
return cmp(self._num, other._num)
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.__cmp__(other) == 0
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self.__eq__(other)
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self._num)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user