[1.7.x] Fixed a flake8 warning.

Backport of f6c208d95c from master