Fix unit test error on Python 3