replaced depreciated function python3
authorGP Orcullo <kinsamanka@gmail.com>
Mon, 31 Oct 2022 14:48:25 +0800
branchpython3
changeset 3768 c032fff8af32
parent 3767 485fe0e78bfd
child 3769 f5124b39ae56
replaced depreciated function

cmp is not used for sorting
controls/LogViewer.py
--- a/controls/LogViewer.py	Sat Oct 29 17:07:41 2022 +0800
+++ b/controls/LogViewer.py	Mon Oct 31 14:48:25 2022 +0800
@@ -24,7 +24,6 @@
 
 
 from datetime import datetime
-from operator import eq
 from time import time as gettime
 from weakref import proxy
 
@@ -237,10 +236,10 @@
         self.Message = msg
         self.DrawDate = True
 
-    def __cmp__(self, other):
+    def __lt__(self, other):
         if self.Date == other.Date:
-            return eq(self.Seconds, other.Seconds)
-        return eq(self.Date, other.Date)
+            return self.Seconds < other.Seconds
+        return self.Date < other.Date
 
     def GetFullText(self):
         date = self.Date.replace(second=int(self.Seconds))