관리-도구
편집 파일: wait.cpython-38.pyc
U ��` � @ s� d dl Z d dlZd dlZd dlmZ zd dlmZ W n ek rT d dlmZ Y nX dddgZG dd� de �Z ejd kr�d d� Zndd� 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 �B/opt/alt/python38/lib/python3.8/site-packages/urllib3/util/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� | }z | |�W S ttjfk r� } zF|jd tjkrR� n.|t� }|dk rhd}|t d�krxd }W Y �qW 5 d }~X Y qX qd S )N�infr )�floatr �OSError�select�error�args�errnoZEINTR)r r Zdeadline�er r r r 0 s Fc C sd |s|st d��g }g }|r&|�| � |r4|�| � ttj|||�}t||�\}}} t|p`|p`| �S )N�2must specify at least one of read=True, write=True)�RuntimeError�appendr r r �bool) �sock�read�writer ZrcheckZwcheckr ZrreadyZwreadyZxreadyr r r �select_wait_for_socketG s r! c s^ |s|st d��d}|r"|tjO }|r0|tjO }t�� � � �| |� � fdd�}tt||��S )Nr r c s | d k r| d9 } � � | �S )Ni� )�poll)�t�Zpoll_objr r �do_pollf s z%poll_wait_for_socket.<locals>.do_poll)r r �POLLIN�POLLOUTr"