"Jd& ddlZddlZddlmZmZdeefdZdeefdZdeefdZdeeeffdZ dS)N)OptionalTuplereturnc:tp tS)z9Returns glibc version string, or None if not using glibc.)glibc_version_string_confstrglibc_version_string_ctypesL/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/utils/glibc.pyglibc_version_stringr s ' ) ) J-H-J-JJr ctjdkrdS tjd\}}n#t t tf$rYdSwxYw|S)z@Primary implementation of glibc_version_string using os.confstr.win32NCS_GNU_LIBC_VERSION)sysplatformosconfstrsplitAttributeErrorOSError ValueError)_versions r rrsm  |wtZ 566<<>> 77 GZ 0tt Ns)>AAc ddl}n#t$rYdSwxYw|d} |j}n#t$rYdSwxYw|j|_|}t|ts| d}|S)z=Fallback implementation of glibc_version_string using ctypes.rNascii) ctypes ImportErrorCDLLgnu_get_libc_versionrc_char_prestype isinstancestrdecode)rprocess_namespacer version_strs r rrs tt D))0E tt $*? &&((K k3 ' '2!((11 s 6 AAc.t}|dSd|fS)zTry 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_versions r libc_verr+Ns% )**Mx''r ) rrtypingrrr#r rrr+r r r r-s """"""""KhsmKKKK hsm"Xc]^ (%S/ ( ( ( ( ( (r