aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/lit/lit/TestRunner.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py
index 3004d2c713..71882b76f8 100644
--- a/utils/lit/lit/TestRunner.py
+++ b/utils/lit/lit/TestRunner.py
@@ -24,11 +24,15 @@ kUseCloseFDs = not kIsWindows
kAvoidDevNull = kIsWindows
def executeCommand(command, cwd=None, env=None):
+ # Close extra file handles on UNIX (on Windows this cannot be done while
+ # also redirecting input).
+ close_fds = not kIsWindows
+
p = subprocess.Popen(command, cwd=cwd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
- env=env)
+ env=env, close_fds=close_fds)
out,err = p.communicate()
exitCode = p.wait()