Fix test on Python 3.x