[1.7.x] Fixed Python 3.4 test failure.

Backport of 45ef4baf5c from master