U
Ê—Re& ã @ sp d dl Z d dlZd dlmZmZ ee dœdd„Zee dœdd„Zee dœdd „Zeeef dœd
d„Z dS )é N)ÚOptionalÚTuple)Úreturnc C s t ƒ p
tƒ 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-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/utils/glibc.pyÚglibc_version_string s r c
C sF t jdkrdS zt d¡ ¡ \} }W n tttfk
r@ Y dS X |S )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 sv zddl } W n tk
r" Y dS X | d¡}z
|j}W n tk
rN Y dS X | j|_|ƒ }t|tƒsr| 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 ƒ } | dkrdS d| fS dS )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 Ú