cleanup: fix some list comprehension redefinitions of existing vars
In all the remaining cases the comprehension variable is used for the same
thing as a previous loop variable.
This will mute some pyflakes "list comprehension redefines" warnings.
To run the tests, do:
cd tests/
python run-tests.py
See http://mercurial.selenic.com/wiki/WritingTests for
more information on writing tests.