관리-도구
편집 파일: wait.cpython-38.pyc
U )�eG � @ s� d dl mZ d dlZd dlZd dlmZ ddgZddddd dd �dd�Zddddd dd �d d�Zdd�dd�Z ddddd dd �dd�a ddd dd�dd�Zddd dd�dd�ZdS )� )�annotationsN)�partial� wait_for_read�wait_for_writeFz socket.socket�bool�float | None)�sock�read�write�timeout�returnc C sb |s|st d��g }g }|r&|�| � |r4|�| � ttj|||�}||�\}}} t|p^|p^| �S )N�2must specify at least one of read=True, write=True)�RuntimeError�appendr �selectr ) r r r r �rcheck�wcheck�fn�rready�wready�xready� r �?/opt/hc_python/lib/python3.8/site-packages/urllib3/util/wait.py�select_wait_for_socket! s r c sd |s|st d��d}|r"|tjO }|r0|tjO }t�� � � �| |� ddd�� fdd�}t||��S )Nr r r zlist[tuple[int, int]])�tr c s | d k r| d9 } � � | �S )Ni� )�poll)r ��poll_objr r �do_pollJ s z%poll_wait_for_socket.<locals>.do_poll)r r �POLLIN�POLLOUTr �registerr )r r r r �maskr r r r �poll_wait_for_socket9 s r# )r c C s: zt �� } | �d� W n ttfk r0 Y dS X dS d S )Nr FT)r r �AttributeError�OSErrorr r r r �_have_working_pollR s r&