]> granicus.if.org Git - python/commitdiff
Fixed bug #1557 by using popen.communicate() before popen.wait()
authorChristian Heimes <christian@cheimes.de>
Wed, 5 Dec 2007 20:10:38 +0000 (20:10 +0000)
committerChristian Heimes <christian@cheimes.de>
Wed, 5 Dec 2007 20:10:38 +0000 (20:10 +0000)
Lib/distutils/msvc9compiler.py

index a6cff2c04e7e162f795d30cc62f5428455d65fad..828d7fbf7a153df6311273d7117682dcfc7675eb 100644 (file)
@@ -254,10 +254,13 @@ def query_vcvarsall(version, arch="x86"):
     popen = subprocess.Popen('"%s" %s & set' % (vcvarsall, arch),
                              stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE)
+
+    stdout, stderr = popen.communicate()
     if popen.wait() != 0:
-        raise IOError(popen.stderr.read())
+        raise IOError(stderr.decode("mbcs"))
 
-    for line in popen.stdout:
+    stdout = stdout.decode("mbcs")
+    for line in stdout.split("\n"):
         line = Reg.convert_mbcs(line)
         if '=' not in line:
             continue