Files
deb-python-wsgi-intercept/wsgi_intercept/urllib3_intercept.py
Chris Dent c464f2ec7a Dedupe the urllib3 monkey patching code
requests vendorizes urllib3 which makes monkey patching it while also
wanting to monkey patch proper urllib3 a bit hairy. Here we use a
factory to do the overrides for us. Hat tip to @FND for helping
with the thinking through of this.
2016-03-18 13:43:34 +00:00

14 lines
521 B
Python

"""Intercept HTTP connections that use
`urllib3 <https://urllib3.readthedocs.org/>`_.
"""
from urllib3.connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.connection import HTTPConnection, HTTPSConnection
from ._urllib3 import make_urllib3_override
install, uninstall = make_urllib3_override(HTTPConnectionPool,
HTTPSConnectionPool,
HTTPConnection,
HTTPSConnection)