[lit] Fix UnboundLocalError for invalid shtest redirects
authorMichal Gorny <mgorny@gentoo.org>
Tue, 25 Jul 2017 22:38:31 +0000 (22:38 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Tue, 25 Jul 2017 22:38:31 +0000 (22:38 +0000)
commitb715df6a738e9dd897e5c6218ad8e817a07f64f8
treebcea5b4092f78a62f9e0b84c9b4160c7663d4cba
parent5e87de3e4e1f818df651b5759ee894599f536d28
[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
llvm/utils/lit/lit/TestRunner.py