[Darwin] Reworking r250003 to use lit.util.capture instead of subprocess.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@250007 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bf64c23851
commit
6bed14b343
@ -6,7 +6,6 @@ import pkgutil
|
|||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
|
||||||
|
|
||||||
import lit.Test # pylint: disable=import-error,no-name-in-module
|
import lit.Test # pylint: disable=import-error,no-name-in-module
|
||||||
import lit.util # pylint: disable=import-error,no-name-in-module
|
import lit.util # pylint: disable=import-error,no-name-in-module
|
||||||
@ -48,11 +47,8 @@ def getSysrootFlagsOnDarwin(config, lit_config):
|
|||||||
# default system root path.
|
# default system root path.
|
||||||
if 'darwin' in config.target_triple:
|
if 'darwin' in config.target_triple:
|
||||||
try:
|
try:
|
||||||
cmd = subprocess.Popen(['xcrun', '--show-sdk-path'],
|
out = lit.util.capture(['xcrun', '--show-sdk-path']).strip()
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
res = 0
|
||||||
out, err = cmd.communicate()
|
|
||||||
out = out.strip()
|
|
||||||
res = cmd.wait()
|
|
||||||
except OSError:
|
except OSError:
|
||||||
res = -1
|
res = -1
|
||||||
if res == 0 and out:
|
if res == 0 and out:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user