Changed Python version check to use sys.version_info