AlkantarClanX12
Current Path : /usr/lib/python3.6/site-packages/urllib3/util/__pycache__/ |
Current File : //usr/lib/python3.6/site-packages/urllib3/util/__pycache__/wait.cpython-36.pyc |
3 nf�\ � @ s� d dl Z d dlmZ d dlZd dlZyd dlmZ W n ek rT d dlmZ Y nX dddgZG dd� de �Z ejdkr�dd� Znd d� Zddd�Z ddd�Zdd� Zdd� Zdd� addd�Zddd�ZdS ) � N)�partial)� monotonic)�time�NoWayToWaitForSocketError� wait_for_read�wait_for_writec @ s e Zd ZdS )r N)�__name__� __module__�__qualname__� r r �/usr/lib/python3.6/wait.pyr s � � c C s | |�S )Nr )�fn�timeoutr r r �_retry_on_intr) s r c C s� |d krt d�}n t� | }xry| |�S ttjfk r� } zB|jd tjkrR� n(|t� }|dk rhd}|t d�krxd }wW Y d d }~X qX qW d S )N�infr )�floatr �OSError�select�error�args�errnoZEINTR)r r Zdeadline�er r r r - s Fc C sh | r| rt d��g }g }|r*|j| � |r8|j| � ttj|||�}t||�\}}} t|pd|pd| �S )Nz2must specify at least one of read=True, write=True)�RuntimeError�appendr r r �bool) �sock�read�writer ZrcheckZwcheckr ZrreadyZwreadyZxreadyr r r �select_wait_for_socketD s r c sb | r| rt d��d}|r&|tjO }|r4|tjO }tj� � � j| |� � fdd�}tt||��S )Nz2must specify at least one of read=True, write=Truer c s | d k r| d9 } � j | �S )Ni� )�poll)�t)�poll_objr r �do_pollc s z%poll_wait_for_socket.<locals>.do_poll)r r ZPOLLINZPOLLOUTr! �registerr r )r r r r �maskr$ r )r# r �poll_wait_for_socketW s r'