s4/dsdb/pytest/sort: use compat.cmp_fn instead of cmp
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 11 Oct 2018 04:23:54 +0000 (17:23 +1300)
committerNoel Power <npower@samba.org>
Thu, 25 Oct 2018 19:45:58 +0000 (21:45 +0200)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <noel.power@suse.com>
source4/dsdb/tests/python/sort.py

index f1247be9e1ffe9c90ad5513b5baee8e9bd877baa..ac989bd43564d6f09d026f43f8e4f143ea462900 100644 (file)
@@ -14,7 +14,7 @@ import re
 sys.path.insert(0, "bin/python")
 import samba
 from samba.tests.subunitrun import SubunitOptions, TestProgram
-
+from samba.compat import cmp_fn
 import samba.getopt as options
 
 from samba.auth import system_session
@@ -286,10 +286,10 @@ class BaseSortTests(samba.tests.TestCase):
             return locale.strcoll(a[0], b[0])
 
         def cmp_binary(a, b):
-            return cmp(a[0], b[0])
+            return cmp_fn(a[0], b[0])
 
         def cmp_numeric(a, b):
-            return cmp(int(a[0]), int(b[0]))
+            return cmp_fn(int(a[0]), int(b[0]))
 
         # For testing simplicity, the attributes in here need to be
         # unique for each user. Otherwise there are multiple possible