mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Fixed bug #1557 by using popen.communicate() before popen.wait()
This commit is contained in:
parent
ba687525c5
commit
cbdb705c88
1 changed files with 6 additions and 3 deletions
|
@ -254,10 +254,13 @@ def query_vcvarsall(version, arch="x86"):
|
||||||
popen = subprocess.Popen('"%s" %s & set' % (vcvarsall, arch),
|
popen = subprocess.Popen('"%s" %s & set' % (vcvarsall, arch),
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
if popen.wait() != 0:
|
|
||||||
raise IOError(popen.stderr.read())
|
|
||||||
|
|
||||||
for line in popen.stdout:
|
stdout, stderr = popen.communicate()
|
||||||
|
if popen.wait() != 0:
|
||||||
|
raise IOError(stderr.decode("mbcs"))
|
||||||
|
|
||||||
|
stdout = stdout.decode("mbcs")
|
||||||
|
for line in stdout.split("\n"):
|
||||||
line = Reg.convert_mbcs(line)
|
line = Reg.convert_mbcs(line)
|
||||||
if '=' not in line:
|
if '=' not in line:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue