Fix test under Py3