summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2009-12-17 02:09:50 (GMT)
committerSteven Knight <knight@baldmt.com>2009-12-17 02:09:50 (GMT)
commitbb01257200549c1d3147928a570986fb5ff88b10 (patch)
tree3b09d6dd0bb64b825badf764dd02392fbff80cc1 /bin
parent2af84ec5c72b588ef67f8988d36066f2859c09a1 (diff)
downloadSCons-bb01257200549c1d3147928a570986fb5ff88b10.zip
SCons-bb01257200549c1d3147928a570986fb5ff88b10.tar.gz
SCons-bb01257200549c1d3147928a570986fb5ff88b10.tar.bz2
Fix the time-scons.py --logfiles option.
Diffstat (limited to 'bin')
-rw-r--r--bin/time-scons.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/bin/time-scons.py b/bin/time-scons.py
index 10684e0..90c6985 100644
--- a/bin/time-scons.py
+++ b/bin/time-scons.py
@@ -114,9 +114,11 @@ class CommandRunner:
if stdout is sys.stdout:
# Same as passing sys.stdout, except works with python2.4.
subout = None
- else:
+ elif stdout is None:
# Open pipe for anything else so Popen works on python2.4.
subout = subprocess.PIPE
+ else:
+ subout = stdout
if stderr is sys.stderr:
# Same as passing sys.stdout, except works with python2.4.
suberr = None
@@ -124,19 +126,12 @@ class CommandRunner:
# Merge with stdout if stderr isn't specified.
suberr = subprocess.STDOUT
else:
- # Open pipe for anything else so Popen works on python2.4.
- suberr = subprocess.PIPE
+ suberr = stderr
p = subprocess.Popen(command,
shell=(sys.platform == 'win32'),
stdout=subout,
stderr=suberr)
p.wait()
- if stdout is None:
- self.stdout = p.stdout.read()
- elif stdout is not sys.stdout:
- stdout.write(p.stdout.read())
- if stderr not in (None, sys.stderr):
- stderr.write(p.stderr.read())
return p.returncode
def run(self, command, display=None, stdout=None, stderr=None):