diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2012-09-14 21:06:25 -0400 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-09-17 22:59:42 +0200 |
commit | fb6c314b6d34ee5c77d7f5fba67bb0bc216ce39b (patch) | |
tree | 73b3fde3e1528ca1d62b19b19555487b6717ff45 | |
parent | 3806cf0d640da3024d50208452d2dd9e3cb015d2 (diff) | |
download | node-fb6c314b6d34ee5c77d7f5fba67bb0bc216ce39b.tar.gz |
configure: always use shlex instead of split
Use shlex module instead of builtin string split to parse CC.
-rwxr-xr-x | configure | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -3,6 +3,7 @@ import optparse import os import pprint import re +import shlex import subprocess import sys @@ -205,7 +206,7 @@ def cc_macros(): """Checks predefined macros using the CC command.""" try: - p = subprocess.Popen(CC.split() + ['-dM', '-E', '-'], + p = subprocess.Popen(shlex.split(CC) + ['-dM', '-E', '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -225,7 +226,6 @@ def cc_macros(): k = {} for line in out: - import shlex lst = shlex.split(line) if len(lst) > 2: key = lst[1] @@ -310,13 +310,13 @@ def host_arch_win(): def compiler_version(): try: - proc = subprocess.Popen(CC.split() + ['--version'], stdout=subprocess.PIPE) + proc = subprocess.Popen(shlex.split(CC) + ['--version'], stdout=subprocess.PIPE) except WindowsError: return (0, False) is_clang = 'clang' in proc.communicate()[0].split('\n')[0] - proc = subprocess.Popen(CC.split() + ['-dumpversion'], stdout=subprocess.PIPE) + proc = subprocess.Popen(shlex.split(CC) + ['-dumpversion'], stdout=subprocess.PIPE) version = tuple(map(int, proc.communicate()[0].split('.'))) return (version, is_clang) |