[1.7.x] Fixed flake8 warning.

Backport of 5cba975d26 from master