]> git.ipfire.org Git - ipfire.org.git/commitdiff
python3: Fix comparing File objects
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Oct 2018 10:33:24 +0000 (11:33 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Oct 2018 10:33:24 +0000 (11:33 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/releases.py

index 2a4f91f79916a14d6ffdfda593fd62a04ff8b2f7..603778828aae173ab1aeeef04119294ac75a7c1f 100644 (file)
@@ -28,8 +28,13 @@ class File(Object):
                # get all data from database
                self.__data = data
 
-       def __cmp__(self, other):
-               return cmp(self.prio, other.prio)
+       def __eq__(self, other):
+               if isinstance(other, self.__class__):
+                       return self.id == otherid
+
+       def __lt__(self, other):
+               if isinstance(other, self.__class__):
+                       return self.prio < other.prio
 
        @property
        def data(self):