
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3
ÝPfµ  ã               @   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j|
|
|ƒ}n&|rÞtj|
|ƒ}n|sæt‚tj	|
|ƒ}|� rü|S tj
||||ƒ}||_|S )z:
    Backport of ``socket.makefile`` from Python 3.5.
    r   ÚwÚbz&invalid mode %r (only r, w, b allowed)Ú é   Nr   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ÚnewlineZwritingZreadingZbinaryZrawmodeÚrawÚbufferÚtext© r   ú/usr/lib/python3.6/makefile.pyÚbackport_makefile   sB    
r   )r   NNNN)Ú__doc__r   Zsocketr   r   r   r   r   r   Ú<module>   s    