From: Douglas Bagnall Date: Thu, 11 Oct 2018 04:23:54 +0000 (+1300) Subject: s4/dsdb/pytest/sort: use compat.cmp_fn instead of cmp X-Git-Tag: tdb-1.3.17~1156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fdccc0d35f0d009e07a9b08edc34dc0fb37c89c;p=thirdparty%2Fsamba.git s4/dsdb/pytest/sort: use compat.cmp_fn instead of cmp Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- diff --git a/source4/dsdb/tests/python/sort.py b/source4/dsdb/tests/python/sort.py index f1247be9e1f..ac989bd4356 100644 --- a/source4/dsdb/tests/python/sort.py +++ b/source4/dsdb/tests/python/sort.py @@ -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