From: Noel Power Date: Fri, 15 Jun 2018 12:06:13 +0000 (+0100) Subject: s4/torture/drs/python: use cmp_fn for cmp (for py2/py3 compat) X-Git-Tag: ldb-1.5.0~287 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=409ad5c0f07445ea7d12466b56fbfbccfe71c2d1;p=thirdparty%2Fsamba.git s4/torture/drs/python: use cmp_fn for cmp (for py2/py3 compat) Signed-off-by: Noel Power Reviewed-by: Andreas Schneider Reviewed-by: Douglas Bagnall --- diff --git a/source4/torture/drs/python/drs_base.py b/source4/torture/drs/python/drs_base.py index c9518ef7358..91b76b3c6aa 100644 --- a/source4/torture/drs/python/drs_base.py +++ b/source4/torture/drs/python/drs_base.py @@ -39,7 +39,7 @@ from ldb import ( Message, FLAG_MOD_REPLACE, ) - +from samba.compat import cmp_fn class DrsBaseTestCase(SambaToolCmdTest): """Base class implementation for all DRS python tests. @@ -515,7 +515,7 @@ class AbstractLink: print("AbstractLink.__internal_cmp__(%r, %r) => wrong type" % (self, other)) return NotImplemented - c = cmp(self.selfGUID_blob, other.selfGUID_blob) + c = cmp_fn(self.selfGUID_blob, other.selfGUID_blob) if c != 0: if verbose: print("AbstractLink.__internal_cmp__(%r, %r) => %d different identifier" % (self, other, c)) @@ -536,7 +536,7 @@ class AbstractLink: print("AbstractLink.__internal_cmp__(%r, %r) => %d different FLAG_ACTIVE" % (self, other, c)) return c - c = cmp(self.targetGUID_blob, other.targetGUID_blob) + c = cmp_fn(self.targetGUID_blob, other.targetGUID_blob) if c != 0: if verbose: print("AbstractLink.__internal_cmp__(%r, %r) => %d different target" % (self, other, c))