Skip to content

Commit

Permalink
Use shlex to split args to subprocesses.
Browse files Browse the repository at this point in the history
  • Loading branch information
nygard committed Jul 16, 2012
1 parent 14191f3 commit 30187d5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Tests/doTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import sys
import argparse
import shlex

# xcodebuild -showsdks

Expand Down Expand Up @@ -56,7 +57,7 @@


try:
developer_root = subprocess.check_output(["xcode-select", "--print-path"]).rstrip()
developer_root = subprocess.check_output(shlex.split("xcode-select --print-path")).rstrip()
except:
developer_root = None
print "Developer root:", developer_root
Expand Down Expand Up @@ -140,16 +141,16 @@ def main(argv):
print args

if args.show_sdks:
subprocess.call(["xcodebuild", "-showsdks"])
subprocess.call(shlex.split("xcodebuild -showsdks"))
sys.exit(0)


sdk_root = None
if args.sdk:
sdk_root = subprocess.check_output(["xcodebuild", "-version", "-sdk", args.sdk, "Path"])
sdk_root = subprocess.check_output(shlex.split("xcodebuild -version -sdk %s Path" % args.sdk))
else:
if args.ios:
sdk_root = subprocess.check_output(["xcodebuild", "-version", "-sdk", "iphoneos", "Path"])
sdk_root = subprocess.check_output(shlex.split("xcodebuild -version -sdk iphoneos Path"))

#print "sdk_root:", sdk_root

Expand Down Expand Up @@ -214,6 +215,7 @@ def main(argv):
arches = proc.stdout.readline().rstrip().split(" ")
print arches
proc.stdout.readlines()
arch_procs = []
for arch in arches:
if arch == "none":
command = [OLD_CD, "-s", "-t", path]
Expand Down

0 comments on commit 30187d5

Please sign in to comment.