[1.7.x] Fixed flake8 warning.

Backport of dec7da3c4c from master