Fix pyflakes for PY3.

This only fixes the files that won't get modified by upcoming PY3 fixes, therefore it does not make pyflakes test pass.