o ÏEc& ã@spddlZddlZddlmZmZdeefdd„Zdeefdd„Zdeefdd „Zdeeeffd d „Z dS) éN)ÚOptionalÚTupleÚreturncCs tƒptƒS)z9Returns glibc version string, or None if not using glibc.)Úglibc_version_string_confstrÚglibc_version_string_ctypes©rrúL/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/utils/glibc.pyÚglibc_version_string s r c CsBtjdkrdSz t d¡ ¡\}}W|Stttfy YdSw)z@Primary implementation of glibc_version_string using os.confstr.Zwin32NÚCS_GNU_LIBC_VERSION)ÚsysÚplatformÚosÚconfstrÚsplitÚAttributeErrorÚOSErrorÚ ValueError)Ú_Úversionrrrrs ýþrcCsrzddl}Wn tyYdSw| d¡}z|j}Wn ty%YdSw|j|_|ƒ}t|tƒs7|  d¡}|S)z=Fallback implementation of glibc_version_string using ctypes.rNÚascii) ÚctypesÚ ImportErrorZCDLLÚgnu_get_libc_versionrZc_char_pZrestypeÚ isinstanceÚstrÚdecode)rZprocess_namespacerZ version_strrrrrs   ÿ   ý  rcCstƒ}|dur dSd|fS)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)ÚrZglibc)r )Z glibc_versionrrrÚlibc_verNsr) r r Útypingrrrr rrrrrrrÚs/