U
    †cUh–  ã                   @   sp   d dl Z d dlZd dlmZmZ ee dœdd„Zee dœdd„Zee dœdd	„Zeeef dœd
d„Z	dS )é    N)ÚOptionalÚTuple)Úreturnc                   C   s   t ƒ p
tƒ S )z9Returns glibc version string, or None if not using glibc.)Úglibc_version_string_confstrÚglibc_version_string_ctypes© r   r   úY/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pip/_internal/utils/glibc.pyÚglibc_version_string   s    r	   c               
   C   sX   t jdkrdS z(t d¡} | dkr(W dS |  ¡ \}}W n tttfk
rR   Y dS X |S )z@Primary implementation of glibc_version_string using os.confstr.Úwin32NÚCS_GNU_LIBC_VERSION)ÚsysÚplatformÚosÚconfstrÚsplitÚAttributeErrorÚOSErrorÚ
ValueError)Zgnu_libc_versionÚ_Úversionr   r   r   r      s    

r   c                  C   s’   zddl } W n tk
r"   Y dS X z|  d¡}W n tk
rH   Y dS X z
|j}W n tk
rj   Y dS X | j|_|ƒ }t|t	ƒsŽ| 
d¡}|S )z=Fallback implementation of glibc_version_string using ctypes.r   NÚascii)ÚctypesÚImportErrorÚCDLLr   Úgnu_get_libc_versionr   Úc_char_pÚrestypeÚ
isinstanceÚstrÚdecode)r   Úprocess_namespacer   Úversion_strr   r   r   r      s"    


r   c                  C   s   t ƒ } | dkrdS d| fS dS )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_versionr   r   r   Úlibc_ver[   s    r%   )
r   r   Útypingr   r   r   r	   r   r   r%   r   r   r   r   Ú<module>   s   <