diff options
author | Mike Gilbert <floppym@gentoo.org> | 2019-03-29 14:49:15 -0400 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2019-05-06 14:08:39 +0200 |
commit | 2dc2935f2aeaa57bb6d066cf9c01f337a8c9e506 (patch) | |
tree | 319b16d73de8e15c1cb1a693cd23d985bd4e793b /setup.py | |
parent | 5b8f77b4e3c2a1b0e2e81c24687f7eb440909fa4 (diff) | |
download | m2crypto-2dc2935f2aeaa57bb6d066cf9c01f337a8c9e506.tar.gz |
Use shlex.split() for CPP
The CPP environment variable is typically used in Makefiles, where it is
passed to a shell for interpretation.
The shlex module simulates shell-compatible word splitting, including
handling of quoted strings.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -17,10 +17,11 @@ import logging import os import platform import re +import shlex +import shutil import string import subprocess import sys -import shutil from distutils.command import build, sdist from distutils.command.clean import clean @@ -51,8 +52,8 @@ def _get_additional_includes(): '*Visual*', 'VC', 'include') err = glob.glob(globmask) else: - pid = subprocess.Popen(os.environ.get('CPP', 'cpp').split() + - ['-Wp,-v', '-'], + cpp = shlex.split(os.environ.get('CPP', 'cpp')) + pid = subprocess.Popen(cpp + ['-Wp,-v', '-'], stdin=open(os.devnull, 'r'), stdout=subprocess.PIPE, stderr=subprocess.PIPE) |