3 ”Re ã@s@ddlmZddlmZddlmZdd„Zdd„Zd d „Z d S) é)Úabsolute_importé)Ú http_client)ÚHeaderParsingErrorcCsfy|jƒStk rYnXy|jStk r8YnXy |jdkStk rXYnXtdƒ‚dS)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)Úobj©r ú�/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/urllib3/util/response.pyÚ is_fp_closeds rcCsvt|tjƒstdjt|ƒƒƒ‚t|ddƒ}t|ddƒ}d}|r^|jƒs^|ƒ}t|tt fƒr^|}|sf|rrt ||d�‚dS)aP Asserts whether all headers have been successfully parsed. Extracts encountered errors from the result of parsing headers. Only works on Python 3. :param headers: Headers to verify. :type headers: `httplib.HTTPMessage`. :raises urllib3.exceptions.HeaderParsingError: If parsing errors are found. z"expected httplib.Message, got {0}.ÚdefectsNÚ get_payload)rÚ unparsed_data) Ú isinstanceÚhttplibÚ HTTPMessageÚ TypeErrorÚformatÚtypeÚgetattrÚ is_multipartÚbytesÚstrr)ÚheadersrrrÚpayloadr r r Úassert_header_parsing&s   rcCs$|j}t|tƒr|dkS|jƒdkS)z° Checks whether the request of a response has been a HEAD-request. Handles the quirks of AppEngine. :param conn: :type conn: :class:`httplib.HTTPResponse` éÚHEAD)Ú_methodrÚintÚupper)ÚresponseÚmethodr r r Úis_response_to_headJs  r&N) Ú __future__rZpackages.six.movesrrÚ exceptionsrrrr&r r r r Ús   $