관리-도구
편집 파일: connectionpool.cpython-36.opt-1.pyc
3 �Pf� � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlmZm Z d dlZddlmZm Z mZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ ddlmZ dd lm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z& dd l'm(Z( ddl)m*Z* ddl+m,Z, dd l-m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6m7Z7 ej8�r<d dl9Z:ej;j<Z<ej=e>�Z?e@� ZAG dd� de@�ZBeCejDejEg�ZFG dd� deBe(�ZGG dd� deG�ZHdd� ZIdd� ZJdS )� )�absolute_importN)�error�timeout� ) �ClosedPoolError� ProtocolError�EmptyPoolError�HeaderParsingError�HostChangedError�LocationValueError� MaxRetryError� ProxyError�ReadTimeoutError�SSLError�TimeoutError�InsecureRequestWarning�NewConnectionError)�CertificateError)�six)�queue)�port_by_scheme�DummyConnection�HTTPConnection�HTTPSConnection�VerifiedHTTPSConnection� HTTPException�BaseSSLError)�RequestMethods)�HTTPResponse)�is_connection_dropped)�set_file_position)�assert_header_parsing)�Retry)�Timeout)�get_host�Urlc @ sD e Zd ZdZdZejZd dd�Zdd� Z dd� Z d d � Zdd� ZdS )�ConnectionPoolzz Base class for all connection pools, such as :class:`.HTTPConnectionPool` and :class:`.HTTPSConnectionPool`. Nc C s. |st d��t|�j� | _|j� | _|| _d S )NzNo host specified.)r � _ipv6_host�lower�host�_proxy_host�port)�selfr) r+ � r- �$/usr/lib/python3.6/connectionpool.py�__init__C s zConnectionPool.__init__c C s dt | �j| j| jf S )Nz%s(host=%r, port=%r))�type�__name__r) r+ )r, r- r- r. �__str__K s zConnectionPool.__str__c C s | S )Nr- )r, r- r- r. � __enter__O s zConnectionPool.__enter__c C s | j � dS )NF)�close)r, �exc_typeZexc_valZexc_tbr- r- r. �__exit__R s zConnectionPool.__exit__c C s dS )zD Close all pooled connections and disable the pool. Nr- )r, r- r- r. r4 W s zConnectionPool.close)N) r1 � __module__�__qualname__�__doc__�schemer Z LifoQueue�QueueClsr/ r2 r3 r6 r4 r- r- r- r. r&