
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
ó
•�abc           @   s>   d  Z  d d l Z d d l m Z d d d d d d „ Z d S(   s�   
backports.makefile
~~~~~~~~~~~~~~~~~~

Backports the Python 3 ``socket.makefile`` method for use with anything that
wants to create a "fake" socket object.
iÿÿÿÿN(   t   SocketIOt   rc         C   s~  t  | ƒ t  d d d g ƒ k s7 t d | f ƒ ‚ n  d | k } d | k pS | } d | k } d }	 | r{ |	 d 7}	 n  | rŽ |	 d 7}	 n  t |  |	 ƒ }
 |  j d 7_ | d
 k rÁ d } n  | d k  rÙ t j } n  | d k rþ | sú t d	 ƒ ‚ n  |
 S| r"| r"t j |
 |
 | ƒ } n- | r=t j |
 | ƒ } n t j	 |
 | ƒ } | rY| St j
 | | | | ƒ } | | _ | S(   s:   
    Backport of ``socket.makefile`` from Python 3.5.
    R   t   wt   bs&   invalid mode %r (only r, w, b allowed)t    i   iÿÿÿÿi    s!   unbuffered streams must be binaryN(   t   sett
   ValueErrorR    t   _makefile_refst   Nonet   iot   DEFAULT_BUFFER_SIZEt   BufferedRWPairt   BufferedReadert   BufferedWritert   TextIOWrappert   mode(   t   selfR   t	   bufferingt   encodingt   errorst   newlinet   writingt   readingt   binaryt   rawmodet   rawt   buffert   text(    (    sS   /usr/lib/python2.7/site-packages/pip/_vendor/urllib3/packages/backports/makefile.pyt   backport_makefile   s>    !		(   t   __doc__R	   t   socketR    R   R   (    (    (    sS   /usr/lib/python2.7/site-packages/pip/_vendor/urllib3/packages/backports/makefile.pyt   <module>   s   	