summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2019-03-11 17:03:29 (GMT)
committerMats Wichmann <mats@linux.com>2019-03-30 13:24:51 (GMT)
commit97c7246f5efb311b007d7aa6b585aa6b47a17230 (patch)
treef9136f64653812657d161949a205fcec7dc1bf7c /src/script
parenta06f5a80a882e4e2e3937b375c4096605ae251d8 (diff)
downloadSCons-97c7246f5efb311b007d7aa6b585aa6b47a17230.zip
SCons-97c7246f5efb311b007d7aa6b585aa6b47a17230.tar.gz
SCons-97c7246f5efb311b007d7aa6b585aa6b47a17230.tar.bz2
[WIP] [PY 3.8] fix more warnings
Several locations with simple usage of deprecated "imp" module changed to use "importlib". These match with work in #3159, but this is not a complete implementation of #3159. More regex patterns are changed to be raw strings. Some strings which did not seem appropriate to change to raw strings (e.g. contain embedded tabs, which Python should honor) had backslashes escaped to avoid accidental Python interpretation. Example: '\t<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.targets" />\n' Python 3.8 was Warning \M was an unknown escape. More open().write(), open().read() style usage changed to use context managers so the file is closed. WIP part: even with Python 3.7, the tests which call sconsign.py fail; oddly they do not fail without the patch to compat.py. sconsign.py does an import using imp module (which is what generates the errors) so needs to be updated anyway. It does not quite fit the "simple usage" pattern - can't do a simple relative import since sconsign is normally located elsewhere in the tree than the main scons code body. With this version of the patch, 700 tests now pass with 3.8, and Warning messages reduced to 2800 (current master has 200 pass, 9000 warns) Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'src/script')
-rw-r--r--src/script/scons-time.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/script/scons-time.py b/src/script/scons-time.py
index ff16ac3..6bcdf16 100644
--- a/src/script/scons-time.py
+++ b/src/script/scons-time.py
@@ -41,6 +41,7 @@ import shutil
import sys
import tempfile
import time
+import subprocess
def HACK_for_exec(cmd, *args):
"""
@@ -443,8 +444,10 @@ class SConsTimer(object):
def log_execute(self, command, log):
command = self.subst(command, self.__dict__)
- with os.popen(command) as p:
- output = p.read()
+ 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