summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2010-11-12 20:31:17 (GMT)
committerÉric Araujo <merwok@netwok.org>2010-11-12 20:31:17 (GMT)
commit4ca58a9fd2c8a41b07a73c4652bac177f0e9b46e (patch)
treed35fde2738567b6952888ca69fb973956bc7e152
parent749930f0f026c8751bb216f1923c0b164e32d54a (diff)
downloadcpython-4ca58a9fd2c8a41b07a73c4652bac177f0e9b46e.zip
cpython-4ca58a9fd2c8a41b07a73c4652bac177f0e9b46e.tar.gz
cpython-4ca58a9fd2c8a41b07a73c4652bac177f0e9b46e.tar.bz2
Merged revisions 86274,86276 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86274 | eric.araujo | 2010-11-06 16:57:52 +0100 (sam., 06 nov. 2010) | 2 lines Correct the fix for #10252: Popen objects have no close method. ........ r86276 | eric.araujo | 2010-11-06 19:03:52 +0100 (sam., 06 nov. 2010) | 2 lines Fix #10252 again (hopefully definitely). Patch by Brian Curtin. ........
-rw-r--r--Lib/distutils/msvc9compiler.py31
1 files changed, 17 insertions, 14 deletions
diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py
index 55a4db1..615d8b8 100644
--- a/Lib/distutils/msvc9compiler.py
+++ b/Lib/distutils/msvc9compiler.py
@@ -277,21 +277,24 @@ def query_vcvarsall(version, arch="x86"):
stdout, stderr = popen.communicate()
if popen.wait() != 0:
raise DistutilsPlatformError(stderr.decode("mbcs"))
+
+ stdout = stdout.decode("mbcs")
+ for line in stdout.split("\n"):
+ line = Reg.convert_mbcs(line)
+ if '=' not in line:
+ continue
+ line = line.strip()
+ key, value = line.split('=', 1)
+ key = key.lower()
+ if key in interesting:
+ if value.endswith(os.pathsep):
+ value = value[:-1]
+ result[key] = removeDuplicates(value)
+
finally:
- popen.close()
-
- stdout = stdout.decode("mbcs")
- for line in stdout.split("\n"):
- line = Reg.convert_mbcs(line)
- if '=' not in line:
- continue
- line = line.strip()
- key, value = line.split('=', 1)
- key = key.lower()
- if key in interesting:
- if value.endswith(os.pathsep):
- value = value[:-1]
- result[key] = removeDuplicates(value)
+ popen.stdin.close()
+ popen.stdout.close()
+ popen.stderr.close()
if len(result) != len(interesting):
raise ValueError(str(list(result.keys())))