a [›ýf& ã@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ú=/usr/lib/python3.9/site-packages/pip/_internal/utils/glibc.pyÚglibc_version_string sr c CsDtjdkrdSzt d¡ ¡\}}Wntttfy>YdS0|S)z@Primary implementation of glibc_version_string using os.confstr.Úwin32NÚCS_GNU_LIBC_VERSION)ÚsysÚplatformÚosÚconfstrÚsplitÚAttributeErrorÚOSErrorÚ ValueError)Ú_Úversionrrrrs rcCsrz ddl}Wnty YdS0| d¡}z |j}WntyJYdS0|j|_|ƒ}t|tƒsn|  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ƒ}|durdSd|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)ÚrZglibc)r )Z glibc_versionrrrÚlibc_verNsr) rr Útypingrrrr rrrrrrrÚs /