HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/urllib3/packages/backports/__pycache__/makefile.cpython-310.pyc
o

�~�`��@s(dZddlZddlmZ	ddd�ZdS)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
Cst|�hd�kstd|f��d|v}d|vp|}|s |s J�d|v}d}	|r,|	d7}	|r2|	d7}	t||	�}
|jd7_|durDd	}|d
krKtj}|d
krW|sUtd��|
S|rc|rct�|
|
|�}n|rlt�|
|�}n
|spJ�t�|
|�}|rz|St�	||||�}||_
|S)z:
    Backport of ``socket.makefile`` from Python 3.5.
    >�br�wz&invalid mode %r (only r, w, b allowed)rrr��N���rz!unbuffered streams must be binary)�set�
ValueErrorr�_makefile_refs�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
TextIOWrapper�mode)
�selfr�	buffering�encoding�errors�newline�writing�reading�binary�rawmode�raw�buffer�text�r�E/usr/lib/python3/dist-packages/urllib3/packages/backports/makefile.py�backport_makefile
s@
r!)rNNNN)�__doc__r�socketrr!rrrr �<module>s
�