Index: cygwinccompiler.py =================================================================== --- cygwinccompiler.py (révision 86263) +++ cygwinccompiler.py (copie de travail) @@ -377,7 +377,9 @@ 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 Index: msvc9compiler.py =================================================================== --- msvc9compiler.py (révision 86263) +++ msvc9compiler.py (copie de travail) @@ -267,22 +267,25 @@ 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() + popen.stdin.close() + popen.stdout.close() + popen.stderr.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) - if len(result) != len(interesting): raise ValueError(str(list(result.keys())))