mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-18 11:20:44 +00:00
python/sepolgen: return NotImplemented instead of raising it
sepolgen uses "return NotImplemented" (in access.py and matching.py) in order to make Python's sorting function use an other call to compare objects. For this to work, "NotImplemented" needs to be returned, not raised like _compare's default implementation does. This issue has been found using flake8. This Python linter reported: python/sepolgen/src/sepolgen/util.py:128:9: F901 'raise NotImplemented' should be 'raise NotImplementedError' Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
parent
03c708d28d
commit
a0c167ed22
@ -123,7 +123,7 @@ class Comparison():
|
||||
_compare function within your class."""
|
||||
|
||||
def _compare(self, other, method):
|
||||
raise NotImplemented
|
||||
return NotImplemented
|
||||
|
||||
def __eq__(self, other):
|
||||
return self._compare(other, lambda a, b: a == b)
|
||||
|
Loading…
Reference in New Issue
Block a user