My theory is that somehow Python's refcounting and GC strategy isn't
closing the subprocess handle in a timely fashion. This accesses the
private '_handle' field of the Popen object, but I see no other way to
do this. If this doesn't address the problem on the sanitizer-windows
buildbot, we can revert this change. If it does, then let's keep the
hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245946
91177308-0d34-0410-b5e6-
96231b3b80d8
exitCode = None
for i,(out,err) in enumerate(procData):
res = procs[i].wait()
+ # On Windows, manually close the process handles.
+ if kIsWindows:
+ procs[i]._handle.Close()
# Detect Ctrl-C in subprocess.
if res == -signal.SIGINT:
raise KeyboardInterrupt