B
    @)H[ê  ã               @   s&   d Z ddlZddlmZ ddd„ZdS )z�
backports.makefile
~~~~~~~~~~~~~~~~~~

Backports the Python 3 ``socket.makefile`` method for use with anything that
wants to create a "fake" socket object.
é    N)ÚSocketIOÚrc             C   s  t |ƒt dddgƒks$td|f ƒ‚d|k}d|kp8| }|sF|sFt‚d|k}d}	|r^|	d7 }	|rj|	d7 }	t| |	ƒ}
|  jd7  _|dkrŽd}|d	k rœtj}|d	kr´|s°td
ƒ‚|
S |rÌ|rÌt |
|
|¡}n&|rÞt |
|¡}n|sæt‚t 	|
|¡}|rú|S t 
||||¡}||_|S )z:
    Backport of ``socket.makefile`` from Python 3.5.
    r   ÚwÚbz&invalid mode %r (only r, w, b allowed)Ú é   Néÿÿÿÿr   z!unbuffered streams must be binary)ÚsetÚ
ValueErrorÚAssertionErrorr   Z_makefile_refsÚioÚDEFAULT_BUFFER_SIZEÚBufferedRWPairÚBufferedReaderÚBufferedWriterÚTextIOWrapperÚmode)Úselfr   Ú	bufferingÚencodingÚerrorsÚnewlineÚwritingÚreadingÚbinaryÚrawmodeÚrawÚbufferÚtext© r   úpC:\Users\HIRONO~1\AppData\Local\Temp\pip-install-qz7kpjmn\pip\pip\_vendor\urllib3\packages\backports\makefile.pyÚbackport_makefile   sB    
r!   )r   NNNN)Ú__doc__r   Úsocketr   r!   r   r   r   r    Ú<module>   s    