File: //usr/lib/python3.6/site-packages/urllib3/__pycache__/response.cpython-36.pyc
3
��yi�� � @ sF d dl mZ d dlmZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl
mZ d dl
m
Z ddlmZ ddlmZmZmZmZmZmZmZmZ dd lmZmZ dd
lmZ ddl!m"Z"m#Z# ddl$m%Z%m&Z& ej'e(�Z)G d
d� de*�Z+G dd� de*�Z,G dd� de*�Z-G dd� de*�Z.dd� Z/G dd� d�Z0G dd� dej1�Z2dS )� )�absolute_import)�contextmanagerN)�timeout)�error� )�HTTPHeaderDict)�BodyNotHttplibCompatible�
ProtocolError�DecodeError�ReadTimeoutError�ResponseNotChunked�IncompleteRead�
InvalidHeader�DependencyWarning)�string_types�PY3)�http_client)�
HTTPException�BaseSSLError)�is_fp_closed�is_response_to_headc @ s2 e Zd Zdd� Zdd� Zddd�Zedd � �Zd
S )
�DeflateDecoderc C s d| _ d| _d| _tj� | _d S )NT� )�
_first_try�_first_try_data�_unfed_data�zlib�
decompressobj�_obj)�self� r �/usr/lib/python3.6/response.py�__init__ s zDeflateDecoder.__init__c C s t | j|�S )N)�getattrr )r �namer r r! �__getattr__! s zDeflateDecoder.__getattr__r c C s� | j | }d| _ | r$| jj r$|S |}|dk r6d}n|dkrH|| _ dS | jsf| jj| jj| |d�S | j|7 _y$| jj||d�}|r�d| _d| _|S tjk
r� d| _tjtj �| _z| j| j|d�S d| _X Y nX d S )Nr r )�
max_lengthF)
r r �unconsumed_tailr �
decompressr r r r � MAX_WBITS)r �datar&