chore: switch to py3 print function

Also fix other problems due to flake8 upgrades.

Change-Id: I5cb6194e48c66e40ec7aa9739eb37550d6bf3e2a