I i@ddlmZddlZddlZddZddZddZddZy) ) annotationsNc.txs tS)z9Returns glibc version string, or None if not using glibc.)glibc_version_string_confstrglibc_version_string_ctypes_/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pip/_internal/utils/glibc.pyglibc_version_stringr s ' ) J-H-JJrctjdk(ry tjd}|y|j \}}|S#t t tf$rYywxYw)z@Primary implementation of glibc_version_string using os.confstr.win32NCS_GNU_LIBC_VERSION)sysplatformosconfstrsplitAttributeErrorOSError ValueError)gnu_libc_version_versions r rr se  ||w::&;<  #%++- 7 N GZ 0sAAAAc ddl} |jd} |j}|j |_|}t|ts|jd}|S#t$rYywxYw#t$rYywxYw#t $rYywxYw)z=Fallback implementation of glibc_version_string using ctypes.rNascii) ctypes ImportErrorCDLLrgnu_get_libc_versionrc_char_prestype isinstancestrdecode)rprocess_namespacer version_strs r rr s""KK-0EE$*?? +-K k3 '!((1 G $  s3A A/ A> A,+A,/ A;:A;> B  B 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*\s )*M''r)returnz str | None)r+ztuple[str, str]) __future__rrrr rrr*rrr r-s$" K ((x (r