summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2019-03-29 14:49:15 -0400
committerMatěj Cepl <mcepl@cepl.eu>2019-05-06 14:08:39 +0200
commit2dc2935f2aeaa57bb6d066cf9c01f337a8c9e506 (patch)
tree319b16d73de8e15c1cb1a693cd23d985bd4e793b /setup.py
parent5b8f77b4e3c2a1b0e2e81c24687f7eb440909fa4 (diff)
downloadm2crypto-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.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 08c73cf..d503577 100644
--- a/setup.py
+++ b/setup.py
@@ -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)