Use sys.version_info instead of sys.version to obtain Python version