o
ai& ã @ sp d dl Z d dlZd dlmZmZ dee fdd„Zdee fdd„Zdee fdd „Zdeeef fd
d„Z dS )é N)ÚOptionalÚTupleÚreturnc C s t ƒ ptƒ S )z9Returns glibc version string, or None if not using glibc.)Úglibc_version_string_confstrÚglibc_version_string_ctypes© r r ú‹/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/utils/glibc.pyÚglibc_version_string s r c
C sB t jdkrdS zt d¡ ¡ \} }W |S tttfy Y dS w )z@Primary implementation of glibc_version_string using os.confstr.Úwin32NÚCS_GNU_LIBC_VERSION)ÚsysÚplatformÚosÚconfstrÚsplitÚAttributeErrorÚOSErrorÚ
ValueError)Ú_Úversionr r r r s
ýþr c C sr zddl } W n
ty Y dS w | d¡}z|j}W n
ty% Y dS w | j|_|ƒ }t|tƒs7| d¡}|S )z=Fallback implementation of glibc_version_string using ctypes.r NÚascii)
ÚctypesÚImportErrorÚCDLLÚgnu_get_libc_versionr Úc_char_pÚrestypeÚ
isinstanceÚstrÚdecode)r Úprocess_namespacer Úversion_strr r r r s ÿ
ý
r c C s t ƒ } | du r dS d| 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)Ú r" Úglibc)r )Ú
glibc_versionr r r Úlibc_verN s r% )
r r Útypingr r r r r r r% r r r r Ú