[libcxx] r306755 - [lit/libcxx] Fix a remaining reference to lit.util.capture() in custom libcxx/Darwin code.
David L. Jones via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 29 16:07:27 PDT 2017
Author: dlj
Date: Thu Jun 29 16:07:27 2017
New Revision: 306755
URL: http://llvm.org/viewvc/llvm-project?rev=306755&view=rev
Log:
[lit/libcxx] Fix a remaining reference to lit.util.capture() in custom libcxx/Darwin code.
Summary:
This reference to lit.util.capture is functionally identical to
subprocess.check_output, so this change switches to call the library routine
directly.
Reviewers: mzolotukhin, EricWF
Reviewed By: mzolotukhin
Subscribers: sanjoy, llvm-commits
Differential Revision: https://reviews.llvm.org/D34841
Modified:
libcxx/trunk/utils/libcxx/test/target_info.py
Modified: libcxx/trunk/utils/libcxx/test/target_info.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/target_info.py?rev=306755&r1=306754&r2=306755&view=diff
==============================================================================
--- libcxx/trunk/utils/libcxx/test/target_info.py (original)
+++ libcxx/trunk/utils/libcxx/test/target_info.py Thu Jun 29 16:07:27 2017
@@ -8,11 +8,11 @@
#===----------------------------------------------------------------------===//
import importlib
-import lit.util # pylint: disable=import-error,no-name-in-module
import locale
import os
import platform
import re
+import subprocess
import sys
class DefaultTargetInfo(object):
@@ -73,12 +73,13 @@ class DarwinLocalTI(DefaultTargetInfo):
super(DarwinLocalTI, self).__init__(full_config)
def is_host_macosx(self):
- name = lit.util.capture(['sw_vers', '-productName']).strip()
+ name = subprocess.check_output(['sw_vers', '-productName']).strip()
return name == "Mac OS X"
def get_macosx_version(self):
assert self.is_host_macosx()
- version = lit.util.capture(['sw_vers', '-productVersion']).strip()
+ version = subprocess.check_output(
+ ['sw_vers', '-productVersion']).strip()
version = re.sub(r'([0-9]+\.[0-9]+)(\..*)?', r'\1', version)
return version
@@ -86,7 +87,7 @@ class DarwinLocalTI(DefaultTargetInfo):
assert self.is_host_macosx()
cmd = ['xcrun', '--sdk', name, '--show-sdk-path']
try:
- out = lit.util.capture(cmd).strip()
+ out = subprocess.check_output(cmd).strip()
except OSError:
pass
@@ -127,7 +128,7 @@ class DarwinLocalTI(DefaultTargetInfo):
else:
cmd = ['xcrun', '--show-sdk-path']
try:
- out = lit.util.capture(cmd).strip()
+ out = subprocess.check_output(cmd).strip()
res = 0
except OSError:
res = -1
More information about the cfe-commits
mailing list