summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2017-07-25 22:38:31 +0000
committerMichal Gorny <mgorny@gentoo.org>2017-07-25 22:38:31 +0000
commitb715df6a738e9dd897e5c6218ad8e817a07f64f8 (patch)
treebcea5b4092f78a62f9e0b84c9b4160c7663d4cba
parent5e87de3e4e1f818df651b5759ee894599f536d28 (diff)
downloadbcm5719-llvm-b715df6a738e9dd897e5c6218ad8e817a07f64f8.tar.gz
bcm5719-llvm-b715df6a738e9dd897e5c6218ad8e817a07f64f8.zip
[lit] Fix UnboundLocalError for invalid shtest redirects
Replace the incorrect variable reference when invalid redirect is used. This fixes the following issue: File "/usr/src/llvm/utils/lit/lit/TestRunner.py", line 316, in processRedirects raise InternalShellError(cmd, "Unsupported redirect: %r" % (r,)) UnboundLocalError: local variable 'r' referenced before assignment which in turn broke shtest-shell.py and max-failures.py lit tests. The breakage was introduced during refactoring in rL307310. Differential Revision: https://reviews.llvm.org/D35857 llvm-svn: 309044
-rw-r--r--llvm/utils/lit/lit/TestRunner.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index 46bcac4b306..a60a0f85487 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -313,7 +313,7 @@ def processRedirects(cmd, stdin_source, cmd_shenv, opened_files):
elif op == ('<',):
redirects[0] = [filename, 'r', None]
else:
- raise InternalShellError(cmd, "Unsupported redirect: %r" % (r,))
+ raise InternalShellError(cmd, "Unsupported redirect: %r" % ((op, filename),))
# Open file descriptors in a second pass.
std_fds = [None, None, None]
OpenPOWER on IntegriCloud