Fix flake8 whinge and py26.

Flake8 was slightly bitrotten, and Python2.6 needs a function from 2.7.

Change-Id: I73d75d83f0801e57fa4cca43ec04aa9205331bf5