AlkantarClanX12

Your IP : 18.189.143.1


Current Path : /opt/alt/python37/lib/python3.7/site-packages/urllib3/util/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/urllib3/util/__pycache__/wait.cpython-37.pyc

B

��`�@s�ddlZddlZddlZddlmZyddlmZWn ek
rTddlmZYnXdddgZGdd�de	�Z
ejd	kr�d
d�Zndd�Zddd�Z
ddd�Zdd�Zdd�Zdd�addd�Zddd�ZdS)�N)�partial)�	monotonic)�time�NoWayToWaitForSocketError�
wait_for_read�wait_for_writec@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�B/opt/alt/python37/lib/python3.7/site-packages/urllib3/util/wait.pyrs)��cCs||�S)Nr)�fn�timeoutrrr�_retry_on_intr*src
Cs�|dkrtd�}n
t�|}xry||�Sttjfk
r�}z@|jdtjkrR�n(|t�}|dkrhd}|td�krxd}wWdd}~XYqXqWdS)N�infr)�floatr�OSError�select�error�args�errnoZEINTR)rrZdeadline�errrr0s


Fc
Csd|s|std��g}g}|r&|�|�|r4|�|�ttj|||�}t||�\}}}	t|p`|p`|	�S)Nz2must specify at least one of read=True, write=True)�RuntimeError�appendrrr�bool)
�sock�read�writerZrcheckZwcheckrZrreadyZwreadyZxreadyrrr�select_wait_for_socketGs

r cs^|s|std��d}|r"|tjO}|r0|tjO}t�����||��fdd�}tt||��S)Nz2must specify at least one of read=True, write=Truercs|dk	r|d9}��|�S)Ni�)�poll)�t)�poll_objrr�do_pollfsz%poll_wait_for_socket.<locals>.do_poll)rr�POLLIN�POLLOUTr!�registerrr)rrrr�maskr$r)r#r�poll_wait_for_socketZs

r)cOstd��dS)Nzno select-equivalent available)r)r�kwargsrrr�null_wait_for_socketnsr+c	Cs:yt��}t|jd�Wnttfk
r0dSXdSdS)NrFT)rr!r�AttributeErrorr)r#rrr�_have_working_pollrsr-cOs*t�rtanttd�rtantat||�S)Nr)r-r)�wait_for_socket�hasattrrr r+)rr*rrrr.s
r.cCst|d|d�S)z�Waits for reading to be available on a given socket.
    Returns True if the socket is readable, or False if the timeout expired.
    T)rr)r.)rrrrrr�scCst|d|d�S)z�Waits for writing to be available on a given socket.
    Returns True if the socket is readable, or False if the timeout expired.
    T)rr)r.)rrrrrr�s)FFN)FFN)N)N)rr�sys�	functoolsrrr�ImportError�__all__�	Exceptionr�version_inforr r)r+r-r.rrrrrr�<module>s&