diff options
| -rw-r--r-- | llvm/utils/lit/lit/TestRunner.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py index 0eb51a82940..a2f97cdb5ef 100644 --- a/llvm/utils/lit/lit/TestRunner.py +++ b/llvm/utils/lit/lit/TestRunner.py @@ -178,6 +178,13 @@ def executeShCmd(cmd, cfg, cwd, results): else: input = subprocess.PIPE + # Explicitly close any redirected files. We need to do this now because we + # need to release any handles we may have on the temporary files (important + # on Win32, for example). Since we have already spawned the subprocess, our + # handles have already been transferred so we do not need them anymore. + for f in opened_files: + f.close() + # FIXME: There is probably still deadlock potential here. Yawn. procData = [None] * len(procs) procData[-1] = procs[-1].communicate() @@ -215,10 +222,6 @@ def executeShCmd(cmd, cfg, cwd, results): else: exitCode = res - # Explicitly close any redirected files. - for f in opened_files: - f.close() - # Remove any named temporary files we created. for f in named_temp_files: try: |

