Fixed Python version check to keep working for Python 4+