HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/pip/_internal/utils/__pycache__/glibc.cpython-310.pyc
o

@%Ne&�@spddlZddlZddlmZmZdeefdd�Zdeefdd�Zdeefdd	�Zdeeeffd
d�Z	dS)�N)�Optional�Tuple�returncCst�pt�S)z9Returns glibc version string, or None if not using glibc.)�glibc_version_string_confstr�glibc_version_string_ctypes�rr�;/usr/lib/python3/dist-packages/pip/_internal/utils/glibc.py�glibc_version_string	sr	c
CsBtjdkrdSzt�d���\}}W|Stttfy YdSw)z@Primary implementation of glibc_version_string using os.confstr.�win32N�CS_GNU_LIBC_VERSION)�sys�platform�os�confstr�split�AttributeError�OSError�
ValueError)�_�versionrrrrs
��rcCsrzddl}Wn
tyYdSw|�d�}z|j}Wn
ty%YdSw|j|_|�}t|t�s7|�	d�}|S)z=Fallback implementation of glibc_version_string using ctypes.rN�ascii)
�ctypes�ImportError�CDLL�gnu_get_libc_versionr�c_char_p�restype�
isinstance�str�decode)r�process_namespacer�version_strrrrrs �

�

rcCst�}|dur	dSd|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.
    N)�r"�glibc)r	)�
glibc_versionrrr�libc_verNsr%)
rr�typingrrrr	rrr%rrrr�<module>s/