Re@sAdZddlZddlmZdddddddZdS)z backports.makefile ~~~~~~~~~~~~~~~~~~ Backports the Python 3 ``socket.makefile`` method for use with anything that wants to create a "fake" socket object. N)SocketIOrc Cst|dddhks.td|fd|k}d|kpJ| }|s_|s_td|k}d} |r| d7} |r| d7} t|| } |jd7_|dkrd }|dkrtj}|dkr|std | S|r|rtj| | |} n9|r7tj| |} n|sCttj | |} |r_| Stj | |||} || _ | S) z: Backport of ``socket.makefile`` from Python 3.5. rwbz&invalid mode %r (only r, w, b allowed)Nrz!unbuffered streams must be binary) set ValueErrorAssertionErrorrZ_makefile_refsioDEFAULT_BUFFER_SIZEBufferedRWPairBufferedReaderBufferedWriter TextIOWrappermode) selfr bufferingencodingerrorsnewlinewritingreadingbinaryrawmoderawbuffertextr/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/urllib3/packages/backports/makefile.pybackport_makefiles@            r!)__doc__r socketrr!rrrr s