Fix test on Python 3