Introduce seven.cmp_ and use it instead of cmp
llvm-svn: 251982
diff --git a/lldb/packages/Python/lldbsuite/support/seven.py b/lldb/packages/Python/lldbsuite/support/seven.py
index 1aab61f..29c6e9e 100644
--- a/lldb/packages/Python/lldbsuite/support/seven.py
+++ b/lldb/packages/Python/lldbsuite/support/seven.py
@@ -5,6 +5,7 @@
get_command_output = commands.getoutput
get_command_status_output = commands.getstatusoutput
+ cmp_ = cmp
else:
def get_command_status_output(command):
try:
@@ -15,3 +16,5 @@
def get_command_output(command):
return get_command_status_output(command)[1]
+
+ cmp_ = lambda x, y: (x > y) - (x < y)
\ No newline at end of file
diff --git a/lldb/packages/Python/lldbsuite/test/dosep.py b/lldb/packages/Python/lldbsuite/test/dosep.py
index 5a37850b..710be29 100644
--- a/lldb/packages/Python/lldbsuite/test/dosep.py
+++ b/lldb/packages/Python/lldbsuite/test/dosep.py
@@ -59,6 +59,7 @@
import dotest_args
import lldb_utils
import process_control
+import lldbsuite.support.seven as seven
# Status codes for running command with timeout.
eTimedOut, ePassed, eFailed = 124, 0, 1
@@ -1244,7 +1245,7 @@
return False
system_version = distutils.version.StrictVersion(platform.mac_ver()[0])
- return cmp(system_version, target_version) < 0
+ return seven.cmp_(system_version, target_version) < 0
def default_test_runner_name(num_threads):