Fix comparison on Python 3