�
��^i�
� �L � d dl mZ d dlmZmZ ddlmZ ddlmZ d� Z
d� Zd� Zd S )
� )�absolute_import)�!MultipartInvariantViolationDefect�StartBoundaryNotFoundDefect� )�HeaderParsingError)�http_clientc �� � | � � � S # t $ r Y nw xY w | j S # t $ r Y nw xY w | j du S # t $ r Y nw xY wt d� � �)zt
Checks whether a given file-like object is closed.
:param obj:
The file-like object to check.
Nz)Unable to determine whether fp is closed.)�isclosed�AttributeError�closed�fp�
ValueError)�objs ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/urllib3/util/response.py�is_fp_closedr s� � �
� �|�|�~�~����
�
�
���
����
��z����
�
�
���
����
� �v��~����
�
�
���
���� �@�
A�
A�As) � �
#�#�. �
;�;�A �
A�Ac � � t | t j � � s/t d� t | � � � � � � �t
| dd� � }t
| dd� � }d}|r<| � � � s( |� � }t |t t f� � r|}|rd� |D � � }|s|rt ||�� � �dS )a>
Asserts whether all headers have been successfully parsed.
Extracts encountered errors from the result of parsing headers.
Only works on Python 3.
:param http.client.HTTPMessage headers: Headers to verify.
:raises urllib3.exceptions.HeaderParsingError:
If parsing errors are found.
z"expected httplib.Message, got {0}.�defectsN�get_payloadc �J � g | ] }t |t t f� � �|��!S � )�
isinstancer r )�.0�defects r �