Fix test error on Python 3