Enable undefined-loop-variable pylint check

This required a trivial refactor of two existing cases in the codebase.

These two cases were perfectly correct, but the check uncovered a 3rd
case which was a real bug (fixed separately).  The new versions also
make it clear that if the loop fails to break early then the 'result' is
None (and thus an error) and not simply the last element.  On balance,
it's probably worth enforcing this small inconvenience to coding style.

Change-Id: I780a95241f1454c6886d91f980eb9ada7678a119
Related-Bug: #1362466
This commit is contained in:
Angus Lees 2014-08-13 15:42:10 +10:00
parent 20d77a868a
commit 48c7e72a41
1 changed files with 0 additions and 1 deletions

View File

@ -56,7 +56,6 @@ disable=
signature-differs,
star-args,
super-init-not-called,
undefined-loop-variable,
unnecessary-lambda,
unnecessary-pass,
unpacking-non-sequence,