Skip to content

Commit d718f56

Browse files
committed
Remove the use of __cmp__ and use __eq__ instead
Signed-off-by: Qin Zhang (张琴) <qin.zhang@citrix.com>
1 parent 52fafe3 commit d718f56

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

XSConsoleHotData.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,16 @@ def __init__(self, inOpaqueRef, inType):
3232
def __repr__(self):
3333
return str(self.__dict__)
3434

35-
# __hash__ and __cmp__ allow this object to be used as a dictionary key
35+
# __hash__ and __eq__ allow this object to be used as a dictionary key
3636
def __hash__(self):
3737
return self.hash
3838

39-
def __cmp__(self, inOther):
39+
def __eq__(self, inOther):
4040
if not isinstance(inOther, HotOpaqueRef):
41-
return 1
41+
return False
4242
if self.opaqueRef == inOther.opaqueRef:
43-
return 0
44-
if self.opaqueRef < inOther.opaqueRef:
45-
return -1
46-
return 1
43+
return True
44+
return False
4745

4846
def OpaqueRef(self): return self.opaqueRef
4947
def Type(self): return self.type

0 commit comments

Comments
 (0)