Viewing File: /opt/hc_python/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/glibc.cpython-312.pyc

�

T�*j���@�ddlmZddlZddlZdd�Zdd�Zdd�Zdd�Zy)	�)�annotationsNc�.�t�xs
t�S)z9Returns glibc version string, or None if not using glibc.)�glibc_version_string_confstr�glibc_version_string_ctypes���H/opt/hc_python/lib/python3.12/site-packages/pip/_internal/utils/glibc.py�glibc_version_stringr
s��'�)�J�-H�-J�Jrc��tjdk(ry	tjd�}|�y|j	�\}}|S#t
ttf$rYywxYw)z@Primary implementation of glibc_version_string using os.confstr.�win32N�CS_GNU_LIBC_VERSION)�sys�platform�os�confstr�split�AttributeError�OSError�
ValueError)�gnu_libc_version�_�versions   r	rrse���|�|�w�����:�:�&;�<���#��%�+�+�-�
��7��N��
�G�Z�0����s�A�A�A�Ac��	ddl}	|jd�}	|j}|j|_|�}t|t�s|jd�}|S#t$rYywxYw#t$rYywxYw#t
$rYywxYw)z=Fallback implementation of glibc_version_string using ctypes.rN�ascii)�ctypes�ImportError�CDLLr�gnu_get_libc_versionr�c_char_p�restype�
isinstance�str�decode)r�process_namespacer�version_strs    r	rr s�����"�"�K�K��-���0�E�E��$*�?�?�� �+�-�K��k�3�'�!�(�(��1�����G�����$�����
����s3�A �A/�A>� 	A,�+A,�/	A;�:A;�>	B
�	B
c�$�t�}|�yd|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.
    )�r'�glibc)r
)�
glibc_versions r	�libc_verr*\s ��)�*�M������'�'r)�returnz
str | None)r+ztuple[str, str])�
__future__rrrr
rrr*rrr	�<module>r-s$��"�	�
�K�
�((�x
(r
Back to Directory File Manager