Kaydet (Commit) 8bdbe9c5 authored tarafından Éric Araujo's avatar Éric Araujo

Correct the fix for #10252: Popen objects have no close method.

üst e7cf9542
......@@ -377,7 +377,9 @@ def _find_exe_version(cmd):
try:
out_string = out.read()
finally:
out.close()
out.stdin.close()
out.stdout.close()
out.stderr.close()
result = RE_VERSION.search(out_string)
if result is None:
return None
......
......@@ -267,21 +267,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())))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment