lit: Don't use close_fds=True on Windows.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 22 Sep 2009 04:44:37 +0000 (04:44 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 22 Sep 2009 04:44:37 +0000 (04:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82521 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/TestRunner.py

index 5fadfd5f175b457c701305eb1f5fa58fcc896146..1501d287d9ff12554ea90b4f1873bbc6b48659d8 100644 (file)
@@ -5,11 +5,15 @@ import ShUtil
 import Test
 import Util
 
+import platform
+
 class InternalShellError(Exception):
     def __init__(self, command, message):
         self.command = command
         self.message = message
 
+# Don't use close_fds on Windows.
+kUseCloseFDs = platform.system() != 'Windows'
 def executeCommand(command, cwd=None, env=None):
     p = subprocess.Popen(command, cwd=cwd,
                          stdin=subprocess.PIPE,
@@ -111,7 +115,7 @@ def executeShCmd(cmd, cfg, cwd, results):
                                       stdout = stdout,
                                       stderr = stderr,
                                       env = cfg.environment,
-                                      close_fds = True))
+                                      close_fds = kUseCloseFDs))
 
         # Immediately close stdin for any process taking stdin from us.
         if stdin == subprocess.PIPE: