summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool/MSCommon/vc.py
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2019-02-09 21:09:33 (GMT)
committerMats Wichmann <mats@linux.com>2019-02-09 21:09:33 (GMT)
commit991594aa3163bec5d247437a2e5b51d95fbd376c (patch)
tree45575a8ad4e27fc1b0512aa41bbceeb6b8f10c86 /src/engine/SCons/Tool/MSCommon/vc.py
parent583fc95f22008f33600c8e76fe23d14a8913f170 (diff)
downloadSCons-991594aa3163bec5d247437a2e5b51d95fbd376c.zip
SCons-991594aa3163bec5d247437a2e5b51d95fbd376c.tar.gz
SCons-991594aa3163bec5d247437a2e5b51d95fbd376c.tar.bz2
Undo part of the windows context manager change
Popen is not a context manager for PY27, lots of tests failed as a result. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'src/engine/SCons/Tool/MSCommon/vc.py')
-rw-r--r--src/engine/SCons/Tool/MSCommon/vc.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py
index adc3d94..4574043 100644
--- a/src/engine/SCons/Tool/MSCommon/vc.py
+++ b/src/engine/SCons/Tool/MSCommon/vc.py
@@ -296,10 +296,12 @@ def find_vc_pdir_vswhere(msvc_version):
vswhere_cmd = [vswhere_path, '-products', '*', '-version', msvc_version, '-property', 'installationPath']
if os.path.exists(vswhere_path):
- with subprocess.Popen(vswhere_cmd,
+ #TODO PY27 cannot use Popen as context manager
+ # try putting it back to the old way for now
+ sp = subprocess.Popen(vswhere_cmd,
stdout=subprocess.PIPE,
- stderr=subprocess.PIPE) as sp:
- vsdir, err = sp.communicate()
+ stderr=subprocess.PIPE)
+ vsdir, err = sp.communicate()
if vsdir:
vsdir = vsdir.decode("mbcs").splitlines()
# vswhere could easily return multiple lines