U
    ‰¾úg  ã                   @  s8   d dl mZ d dlZd dlZd dlZdddœdd„ZdS )é    )ÚannotationsNzsocket.socket | NoneÚbool)ÚsockÚreturnc                 C  s†   | dkrdn|   ¡ }|dks$|dk r(dS tjdksBttddƒdkrbt |gg g d¡\}}}t|ƒS t ¡ }| |tj¡ t| d¡ƒS )zß
    Return whether a socket, as identifed by its file descriptor, is readable.
    "A socket is readable" means that the read buffer isn't empty, i.e. that calling
    .recv() on it would immediately return some data.
    Nr   TÚwin32Úpoll)	ÚfilenoÚsysÚplatformÚgetattrÚselectr   r   ÚregisterÚPOLLIN)r   Zsock_fdÚrreadyÚ_Úp© r   ú3/tmp/pip-unpacked-wheel-hgeblu65/httpcore/_utils.pyÚis_socket_readable   s    	ÿÿr   )Ú
__future__r   r   Úsocketr	   r   r   r   r   r   Ú<module>   s   