summaryrefslogtreecommitdiff
path: root/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/urllib3/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/urllib3/__init__.py')
-rw-r--r--venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/urllib3/__init__.py97
1 files changed, 0 insertions, 97 deletions
diff --git a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/urllib3/__init__.py b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/urllib3/__init__.py
deleted file mode 100644
index 1bffade..0000000
--- a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/urllib3/__init__.py
+++ /dev/null
@@ -1,97 +0,0 @@
1"""
2urllib3 - Thread-safe connection pooling and re-using.
3"""
4
5from __future__ import absolute_import
6import warnings
7
8from .connectionpool import (
9 HTTPConnectionPool,
10 HTTPSConnectionPool,
11 connection_from_url
12)
13
14from . import exceptions
15from .filepost import encode_multipart_formdata
16from .poolmanager import PoolManager, ProxyManager, proxy_from_url
17from .response import HTTPResponse
18from .util.request import make_headers
19from .util.url import get_host
20from .util.timeout import Timeout
21from .util.retry import Retry
22
23
24# Set default logging handler to avoid "No handler found" warnings.
25import logging
26try: # Python 2.7+
27 from logging import NullHandler
28except ImportError:
29 class NullHandler(logging.Handler):
30 def emit(self, record):
31 pass
32
33__author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'
34__license__ = 'MIT'
35__version__ = '1.22'
36
37__all__ = (
38 'HTTPConnectionPool',
39 'HTTPSConnectionPool',
40 'PoolManager',
41 'ProxyManager',
42 'HTTPResponse',
43 'Retry',
44 'Timeout',
45 'add_stderr_logger',
46 'connection_from_url',
47 'disable_warnings',
48 'encode_multipart_formdata',
49 'get_host',
50 'make_headers',
51 'proxy_from_url',
52)
53
54logging.getLogger(__name__).addHandler(NullHandler())
55
56
57def add_stderr_logger(level=logging.DEBUG):
58 """
59 Helper for quickly adding a StreamHandler to the logger. Useful for
60 debugging.
61
62 Returns the handler after adding it.
63 """
64 # This method needs to be in this __init__.py to get the __name__ correct
65 # even if urllib3 is vendored within another package.
66 logger = logging.getLogger(__name__)
67 handler = logging.StreamHandler()
68 handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))
69 logger.addHandler(handler)
70 logger.setLevel(level)
71 logger.debug('Added a stderr logging handler to logger: %s', __name__)
72 return handler
73
74
75# ... Clean up.
76del NullHandler
77
78
79# All warning filters *must* be appended unless you're really certain that they
80# shouldn't be: otherwise, it's very hard for users to use most Python
81# mechanisms to silence them.
82# SecurityWarning's always go off by default.
83warnings.simplefilter('always', exceptions.SecurityWarning, append=True)
84# SubjectAltNameWarning's should go off once per host
85warnings.simplefilter('default', exceptions.SubjectAltNameWarning, append=True)
86# InsecurePlatformWarning's don't vary between requests, so we keep it default.
87warnings.simplefilter('default', exceptions.InsecurePlatformWarning,
88 append=True)
89# SNIMissingWarnings should go off only once.
90warnings.simplefilter('default', exceptions.SNIMissingWarning, append=True)
91
92
93def disable_warnings(category=exceptions.HTTPWarning):
94 """
95 Helper for quickly disabling all urllib3 warnings.
96 """
97 warnings.simplefilter('ignore', category)