diff options
author | Anders Carlsson <andersca@mac.com> | 2008-02-06 19:03:27 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2008-02-06 19:03:27 +0000 |
commit | dac2b54b1c6e91569585ef9904295feda2ef3ae9 (patch) | |
tree | 1c9dcd2ecee4626b2fdafe97903f9321031db165 | |
parent | c60f0f79c962e1e91538546173d7f5ede1f5a89c (diff) |
Use the subprocess module instead of os.system. Patch by Sam Bishop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46819 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-x | utils/ccc | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -11,30 +11,32 @@ # ##===----------------------------------------------------------------------===## -import os import sys +import subprocess def error(message): print >> sys.stderr, 'ccc: ' + message sys.exit(1) def run(args): - cmd = ' '.join(args) - print >> sys.stderr, cmd - code = os.system(cmd) + print >> sys.stderr, ' '.join(args) + code = subprocess.call(args) if code > 255: code = 1 if code: sys.exit(code) def preprocess(args): - run(['clang -E'] + args) + command = 'clang -E'.split() + run(command + args) def compile(args): - run(['clang -emit-llvm-bc'] + args) + command = 'clang -emit-llvm-bc'.split() + run(command + args) def link(args): - run(['llvm-ld -native'] + args) + command = 'llvm-ld -native'.split() + run(command + args) def extension(path): return path.split(".")[-1] |