U å·€g–ã@spddlZddlZddlmZmZeedœdd„Zeedœdd„Zeedœdd „Zeeefdœd d „Z dS) éN)ÚOptionalÚTuple)ÚreturncCs tƒp tƒS)z9Returns glibc version string, or None if not using glibc.)Úglibc_version_string_confstrÚglibc_version_string_ctypes©rrúG/opt/hc_python/lib/python3.8/site-packages/pip/_internal/utils/glibc.pyÚglibc_version_stringsr c CsXtjdkrdSz(t d¡}|dkr(WdS| ¡\}}Wntttfk rRYdSX|S)z@Primary implementation of glibc_version_string using os.confstr.Úwin32NÚCS_GNU_LIBC_VERSION)ÚsysÚplatformÚosÚconfstrÚsplitÚAttributeErrorÚOSErrorÚ ValueError)Úgnu_libc_versionÚ_Úversionrrrr s  rcCs’z ddl}Wntk r"YdSXz| d¡}Wntk rHYdSXz |j}Wntk rjYdSX|j|_|ƒ}t|t ƒsŽ|  d¡}|S)z=Fallback implementation of glibc_version_string using ctypes.rNÚascii) ÚctypesÚ ImportErrorÚCDLLrÚgnu_get_libc_versionrÚc_char_pÚrestypeÚ isinstanceÚstrÚdecode)rÚprocess_namespacerÚ version_strrrrrs"    rcCstƒ}|dkrdSd|fSdS)z“Try to determine the glibc version Returns a tuple of strings (lib, version) which default to empty strings in case the lookup fails. N)Úr#Úglibc)r )Ú glibc_versionrrrÚlibc_ver[sr&) rr Útypingrrrr rrr&rrrrÚs <