[Lldb-commits] [lldb] r251982 - Introduce seven.cmp_ and use it instead of cmp
Zachary Turner via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 3 13:37:27 PST 2015
Author: zturner
Date: Tue Nov 3 15:37:27 2015
New Revision: 251982
URL: http://llvm.org/viewvc/llvm-project?rev=251982&view=rev
Log:
Introduce seven.cmp_ and use it instead of cmp
Modified:
lldb/trunk/packages/Python/lldbsuite/support/seven.py
lldb/trunk/packages/Python/lldbsuite/test/dosep.py
Modified: lldb/trunk/packages/Python/lldbsuite/support/seven.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/support/seven.py?rev=251982&r1=251981&r2=251982&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/support/seven.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/support/seven.py Tue Nov 3 15:37:27 2015
@@ -5,6 +5,7 @@ if six.PY2:
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 @@ else:
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
Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dosep.py?rev=251982&r1=251981&r2=251982&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dosep.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dosep.py Tue Nov 3 15:37:27 2015
@@ -59,6 +59,7 @@ import dotest_channels
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 @@ def is_darwin_version_lower_than(target_
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):
More information about the lldb-commits
mailing list