aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test/dotest.py
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-11-03 18:55:22 +0000
committerZachary Turner <zturner@google.com>2015-11-03 18:55:22 +0000
commitbb03a4660f669bff3875ce00c1d4acaf28c244ef (patch)
tree11dfd9a5292d0635b89514c5e92408b38c1d93c3 /lldb/packages/Python/lldbsuite/test/dotest.py
parente7fe1a46e4213842fc2f2c0b0dcd4232923bac20 (diff)
downloadllvm-bb03a4660f669bff3875ce00c1d4acaf28c244ef.zip
llvm-bb03a4660f669bff3875ce00c1d4acaf28c244ef.tar.gz
llvm-bb03a4660f669bff3875ce00c1d4acaf28c244ef.tar.bz2
Python 3 - Don't use `commands` module anymore.
The `commands` module was deprecated in 2.7 and removed in 3.x. As a workaround, we introduce a new module `seven` in lldbsuite.support, and write helper functions in there that delegate to the commands module if it is available, and re-implement their functionality for cases where it is not available. llvm-svn: 251959
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/dotest.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index 9148b34..8b235b1 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -25,7 +25,6 @@ import lldbsuite
import lldbtest_config
import atexit
-import commands
import importlib
import os
import dotest_args
@@ -43,6 +42,7 @@ import unittest2
import test_categories
import six
+import lldbsuite.support.seven as seven
def is_exe(fpath):
"""Returns true if fpath is an executable."""
@@ -512,7 +512,7 @@ def parseOptionsAndInitTestdirs():
else:
# Use a compiler appropriate appropriate for the Apple SDK if one was specified
if platform_system == 'Darwin' and args.apple_sdk:
- compilers = [commands.getoutput('xcrun -sdk "%s" -find clang 2> /dev/null' % (args.apple_sdk))]
+ compilers = [seven.get_command_output('xcrun -sdk "%s" -find clang 2> /dev/null' % (args.apple_sdk))]
else:
# 'clang' on ubuntu 14.04 is 3.4 so we try clang-3.5 first
candidateCompilers = ['clang-3.5', 'clang', 'gcc']
@@ -529,15 +529,15 @@ def parseOptionsAndInitTestdirs():
# Set SDKROOT if we are using an Apple SDK
if platform_system == 'Darwin' and args.apple_sdk:
- os.environ['SDKROOT'] = commands.getoutput('xcrun --sdk "%s" --show-sdk-path 2> /dev/null' % (args.apple_sdk))
+ os.environ['SDKROOT'] = seven.get_command_output('xcrun --sdk "%s" --show-sdk-path 2> /dev/null' % (args.apple_sdk))
if args.archs:
archs = args.archs
for arch in archs:
if arch.startswith('arm') and platform_system == 'Darwin' and not args.apple_sdk:
- os.environ['SDKROOT'] = commands.getoutput('xcrun --sdk iphoneos.internal --show-sdk-path 2> /dev/null')
+ os.environ['SDKROOT'] = seven.get_command_output('xcrun --sdk iphoneos.internal --show-sdk-path 2> /dev/null')
if not os.path.exists(os.environ['SDKROOT']):
- os.environ['SDKROOT'] = commands.getoutput('xcrun --sdk iphoneos --show-sdk-path 2> /dev/null')
+ os.environ['SDKROOT'] = seven.get_command_output('xcrun --sdk iphoneos --show-sdk-path 2> /dev/null')
else:
archs = [platform_machine]