3 šig& ã@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ú8/tmp/pip-build-88gy_88q/pip/pip/_internal/utils/glibc.pyÚglibc_version_string sr c CsDtjdkrdSytjdƒjƒ\}}Wntttfk r>dSX|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 rcCsry ddl}Wntk r dSX|jdƒ}y |j}Wntk rJdSX|j|_|ƒ}t|tƒsn|j dƒ}|S)z=Fallback implementation of glibc_version_string using ctypes.rNÚascii) ÚctypesÚ ImportErrorÚCDLLÚ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ÚÚglibc)r"r")r )Ú glibc_versionrrrÚlibc_verNsr%) rr Ztypingrrrr rrr%rrrrÚs /