Fix test under Python 2