Update accrording new flake8

Includes backport of fix for #1299287.

Closes-bug: #1311799
Change-Id: I49b9898eb6d3770c64fb458a6b63deecd8001a39