mirror of https://github.com/python/cpython
Correct the fix for #10252: Popen objects have no close method.
This commit is contained in:
parent
e7cf954247
commit
8bdbe9c52f
|
@ -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,8 +267,6 @@ def query_vcvarsall(version, arch="x86"):
|
|||
stdout, stderr = popen.communicate()
|
||||
if popen.wait() != 0:
|
||||
raise DistutilsPlatformError(stderr.decode("mbcs"))
|
||||
finally:
|
||||
popen.close()
|
||||
|
||||
stdout = stdout.decode("mbcs")
|
||||
for line in stdout.split("\n"):
|
||||
|
@ -283,6 +281,11 @@ def query_vcvarsall(version, arch="x86"):
|
|||
value = value[:-1]
|
||||
result[key] = removeDuplicates(value)
|
||||
|
||||
finally:
|
||||
popen.stdin.close()
|
||||
popen.stdout.close()
|
||||
popen.stderr.close()
|
||||
|
||||
if len(result) != len(interesting):
|
||||
raise ValueError(str(list(result.keys())))
|
||||
|
||||
|
|
Loading…
Reference in New Issue