[1.6.x] Fixed Python 3 syntax error introduced in [c72392da]

Backport of 498014ccd5 from master