Fix error test case in Python 3