# Try to use subprocess instead of the more low-level
+ not suppress_stdout and
+ # If no suppress mode is selected, we still use the
+ # old spawn routines instead of the modern subprocess module.
+ # This is important for the test/runtest scripts, where we
+ # call runtest.py within the single tests. With subprocess the
+ # stderr of the subprocess lands in stdout of the top test script,
+ # which lets the test fail. :(
+ # TODO: find a way to use subprocess with proper stream redirection...
p = subprocess.Popen(' '.join(command_args),
spawned_stdout = p.stdout.read()
spawned_stderr = p.stderr.read()
return (spawned_stderr, spawned_stdout, p.wait())
# Set up lowest-common-denominator spawning of a process on both Windows
# and non-Windows systems that works all the way back to Python 1.5.2.
sys.stdout.write("Unexpected exit status %d\n" % s)