[1.7.x] Fixed flake8 warning.

Backport of f9f9f3ad60 from master