ó •abc@s>dZddlZddlmZdddddd„ZdS(s backports.makefile ~~~~~~~~~~~~~~~~~~ Backports the Python 3 ``socket.makefile`` method for use with anything that wants to create a "fake" socket object. i˙˙˙˙N(tSocketIOtrc Csœt|ƒtdddgƒks7td|fƒ‚nd|k}d|kpS| }|sh|sht‚d|k}d} |r| d7} n|r | d7} nt|| ƒ} |jd7_|d krÓd}n|dkrëtj}n|dkr|s td ƒ‚n| S|r4|r4tj| | |ƒ} n9|rOtj | |ƒ} n|s[t‚tj | |ƒ} |rw| Stj | |||ƒ} || _ | S( s: Backport of ``socket.makefile`` from Python 3.5. Rtwtbs&invalid mode %r (only r, w, b allowed)tii˙˙˙˙is!unbuffered streams must be binaryN( tsett ValueErrortAssertionErrorRt_makefile_refstNonetiotDEFAULT_BUFFER_SIZEtBufferedRWPairtBufferedReadertBufferedWritert TextIOWrappertmode( tselfRt bufferingtencodingterrorstnewlinetwritingtreadingtbinarytrawmodetrawtbufferttext((sS/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/packages/backports/makefile.pytbackport_makefilesB!            (t__doc__R tsocketRR R(((sS/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/packages/backports/makefile.pyts