__cmp__ is deprecated in python3

This commit is contained in:
Open Toontown 2022-01-16 23:30:45 -05:00
parent c17cbffc47
commit 949fc5e50e

View file

@ -253,11 +253,23 @@ class CatalogItem:
def getHashContents(self): def getHashContents(self):
return None return None
def __cmp__(self, other): def __lt__(self, other):
c = cmp(self.__class__, other.__class__) c = self.__class__ == other.__class__
if c != 0: if not c:
return c return 0
return self.compareTo(other) return self.compareTo(other) < 0
def __gt__(self, other):
c = self.__class__ == other.__class__
if not c:
return 0
return self.compareTo(other) > 0
def __eq__(self, other):
c = self.__class__ == other.__class__
if not c:
return 0
return self.compareTo(other) == 0
def __hash__(self): def __hash__(self):
return hash((self.__class__, self.getHashContents())) return hash((self.__class__, self.getHashContents()))