diff options
author | Greg Noel <GregNoel@tigris.org> | 2008-08-28 18:34:51 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2008-08-28 18:34:51 (GMT) |
commit | 78ebf9fe184b5724861996870e1f09902efcb1eb (patch) | |
tree | dd6c2cb10113104c29594669542862a99acc729c /src/engine/SCons/Environment.py | |
parent | 7902585ee8d1e84e2ae76289306d6858cd8f2277 (diff) | |
download | SCons-78ebf9fe184b5724861996870e1f09902efcb1eb.zip SCons-78ebf9fe184b5724861996870e1f09902efcb1eb.tar.gz SCons-78ebf9fe184b5724861996870e1f09902efcb1eb.tar.bz2 |
Issue 2007: backtick() doesn't use ENV
Diffstat (limited to 'src/engine/SCons/Environment.py')
-rw-r--r-- | src/engine/SCons/Environment.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index db69d62..67881eb 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -526,17 +526,21 @@ class SubstitutionEnvironment: def backtick(self, command): import subprocess - if SCons.Util.is_List(command): - p = subprocess.Popen(command, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - universal_newlines=True) - else: - p = subprocess.Popen(command, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - universal_newlines=True, - shell=True) + # common arguments + kw = { 'stdout' : subprocess.PIPE, + 'stderr' : subprocess.PIPE, + 'universal_newlines' : True, + } + # if the command is a list, assume it's been quoted + # othewise force a shell + if not SCons.Util.is_List(command): kw['shell'] = True + # a SubstutionEnvironment has no ENV, so only add it + # to the args if it exists + e = self._dict.get('ENV') + if e: kw['env'] = e + # run constructed command + #FUTURE p = subprocess.Popen(command, **kw) + p = apply(subprocess.Popen, (command,), kw) out = p.stdout.read() p.stdout.close() err = p.stderr.read() |