R`i) p d dl Z d dlZd dlmZmZ dee fdZdee fdZdee fdZdeeef fdZ y) N)OptionalTuplereturnc . t xs
t S )z9Returns glibc version string, or None if not using glibc.)glibc_version_string_confstrglibc_version_string_ctypes /builddir/build/BUILDROOT/alt-python312-pip-23.3.1-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_internal/utils/glibc.pyglibc_version_stringr s ')J-H-JJr
c t j dk( ry t j d } | y| j \ }}|S # t
t t f$ r Y yw xY w)z@Primary implementation of glibc_version_string using os.confstr.win32NCS_GNU_LIBC_VERSION)sysplatformosconfstrsplitAttributeErrorOSError
ValueError)gnu_libc_version_versions r r r se ||w::&;<#%++-
7 N
GZ0 s A A AAc ddl } | j d } |j }| j
|_ | }t |t s|j d }|S # t $ r Y yw xY w# t $ r Y yw xY w)z=Fallback implementation of glibc_version_string using ctypes.r Nascii)
ctypesImportErrorCDLLgnu_get_libc_versionr c_char_prestype
isinstancestrdecode)r process_namespacer version_strs r r r s D)0EE $*?? &(Kk3'!((1- s" A A. A+*A+. A:9A:c $ t } | yd| fS )zTry to determine the glibc version
Returns a tuple of strings (lib, version) which default to empty strings
in case the lookup fails.
) r) glibc)r )
glibc_versions r libc_verr, N s )*M''r
)
r r typingr r r$ r r r r, r r
r