diff options
author | Mats Wichmann <mats@linux.com> | 2019-03-18 14:27:02 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-03-30 13:24:51 (GMT) |
commit | a1a76026505d444ad04fd3494badcdacf8e58857 (patch) | |
tree | d2dce5dca613a8359fdd3a6fdcde6616fbaf9073 /src/script | |
parent | 97c7246f5efb311b007d7aa6b585aa6b47a17230 (diff) | |
download | SCons-a1a76026505d444ad04fd3494badcdacf8e58857.zip SCons-a1a76026505d444ad04fd3494badcdacf8e58857.tar.gz SCons-a1a76026505d444ad04fd3494badcdacf8e58857.tar.bz2 |
[PY 3.8] roll back scons-time to use os.popen
For PR #3331: the change in src/script/scons-time.py to use subprocess
in log_execute caused failures on Windows platform. For now, go back
to os.popen, but save the open descriptor so it can be closed (that
was the original warning being addressed).
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/scons-time.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/script/scons-time.py b/src/script/scons-time.py index 6bcdf16..39a6e64 100644 --- a/src/script/scons-time.py +++ b/src/script/scons-time.py @@ -444,10 +444,14 @@ class SConsTimer(object): def log_execute(self, command, log): command = self.subst(command, self.__dict__) - process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) - output = process.stdout.read() - process.stdout.close() - process.wait() + p = os.popen(command) + output = p.read() + p.close() + #TODO: convert to subrocess, os.popen is obsolete. This didn't work: + #process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) + #output = process.stdout.read() + #process.stdout.close() + #process.wait() if self.verbose: sys.stdout.write(output) # TODO: Figure out |