Use sys.version_info to determine Python version