ó >´­_c@@seddlmZddlmZmZddlmZddlmZ d„Z d„Z d„Z d S( i(tabsolute_import(t!MultipartInvariantViolationDefecttStartBoundaryNotFoundDefecti(tHeaderParsingError(t http_clientcC@svy|jƒSWntk r!nXy |jSWntk r@nXy|jdkSWntk renXtdƒ‚dS(st Checks whether a given file-like object is closed. :param obj: The file-like object to check. s)Unable to determine whether fp is closed.N(tisclosedtAttributeErrortclosedtfptNonet ValueError(tobj((s@/opt/awscli/lib/python2.7/site-packages/urllib3/util/response.pyt is_fp_closed s    cC@søt|tjƒs0tdjt|ƒƒƒ‚nt|ddƒ}t|ddƒ}d}|r™|jƒs™|ƒ}t|t t fƒr–|}q–q™n|rÐg|D]!}t|t t fƒs¦|^q¦}n|sÜ|rôt d|d|ƒ‚ndS(s> 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. s"expected httplib.Message, got {0}.tdefectst get_payloadt unparsed_dataN(t isinstancethttplibt HTTPMessaget TypeErrortformatttypetgetattrR t is_multiparttbyteststrRRR(theadersR RRtpayloadtdefect((s@/opt/awscli/lib/python2.7/site-packages/urllib3/util/response.pytassert_header_parsing(s"    ! cC@s2|j}t|tƒr"|dkS|jƒdkS(sõ Checks whether the request of a response has been a HEAD-request. Handles the quirks of AppEngine. :param http.client.HTTPResponse response: Response to check if the originating request used 'HEAD' as a method. itHEAD(t_methodRtinttupper(tresponsetmethod((s@/opt/awscli/lib/python2.7/site-packages/urllib3/util/response.pytis_response_to_head^s  N( t __future__Rt email.errorsRRt exceptionsRtpackages.six.movesRRR RR$(((s@/opt/awscli/lib/python2.7/site-packages/urllib3/util/response.pyts   6