[1.7.x] Fixed flake8 warning.

Backport of ef9e3c5ed8 from master