Fix version check to work on Python 3