Hacked By AnonymousFox

Current Path : /lib/python3.6/site-packages/urllib3/util/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/urllib3/util/__pycache__/wait.cpython-36.pyc

3

nf�\�@s�ddlZddlmZddlZddlZyddlmZWn ek
rTddlmZYnXdddgZGdd�de	�Z
ejdkr�dd�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�/usr/lib/python3.6/wait.pyr
s��cCs||�S)Nr)�fn�timeoutrrr�_retry_on_intr)srcCs�|dkrtd�}n
t�|}xry||�Sttjfk
r�}zB|jdtjkrR�n(|t�}|dkrhd}|td�krxd}wWYdd}~XqXqWdS)N�infr)�floatr�OSError�select�error�args�errnoZEINTR)rrZdeadline�errrr-s


Fc
Csh|r|rtd��g}g}|r*|j|�|r8|j|�ttj|||�}t||�\}}}	t|pd|pd|	�S)Nz2must specify at least one of read=True, write=True)�RuntimeError�appendrrr�bool)
�sock�read�writerZrcheckZwcheckrZrreadyZwreadyZxreadyrrr�select_wait_for_socketDs

r csb|r|rtd��d}|r&|tjO}|r4|tjO}tj���j||��fdd�}tt||��S)Nz2must specify at least one of read=True, write=Truercs|dk	r|d9}�j|�S)Ni�)�poll)�t)�poll_objrr�do_pollcsz%poll_wait_for_socket.<locals>.do_poll)rrZPOLLINZPOLLOUTr!�registerrr)rrrr�maskr$r)r#r�poll_wait_for_socketWs

r'cOstd��dS)Nzno select-equivalent available)r)r�kwargsrrr�null_wait_for_socketksr)cCs:ytj�}t|jd�Wnttfk
r0dSXdSdS)NrFT)rr!r�AttributeErrorr)r#rrr�_have_working_pollos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)r
r)FFN)FFN)N)N)r�	functoolsrr�sysrr�ImportError�__all__�	Exceptionr�version_inforr r'r)r+r,rrrrrr�<module>s&








Hacked By AnonymousFox1.0, Coded By AnonymousFox