OSDN Git Service

[lit] Fix an uninitialized var on Windows.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 7 Jun 2016 20:14:17 +0000 (20:14 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 7 Jun 2016 20:14:17 +0000 (20:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272052 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/TestRunner.py

index f6dfd46..adf3d62 100644 (file)
@@ -255,6 +255,7 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
                 result = subprocess.PIPE
             else:
                 if r[2] is None:
+                    redir_filename = None
                     if kAvoidDevNull and r[0] == '/dev/null':
                         r[2] = tempfile.TemporaryFile(mode=r[1])
                     elif kIsWindows and r[0] == '/dev/tty':
@@ -398,7 +399,7 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
         # Gather the redirected output files.
         output_files = []
         for (name, mode, f, path) in sorted(opened_files):
-            if mode in ('w', 'a'):
+            if path is not None and mode in ('w', 'a'):
                 try:
                     with open(path) as f:
                         data = f.read()