Fix test failure on Python 3