Fix failing test on Python 2