1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

Fallback to importing from urllib3

requests.packages.urllib3 may be literally urllib3
instead of vendored urllib3.
This commit is contained in:
John Vandenberg
2015-10-15 14:56:30 +11:00
parent 1324feae99
commit dd8b39b29e

View File

@@ -1,6 +1,10 @@
'''Stubs for requests'''
from requests.packages.urllib3.connectionpool import HTTPConnection, VerifiedHTTPSConnection
try:
from requests.packages.urllib3.connectionpool import HTTPConnection, VerifiedHTTPSConnection
except ImportError:
from urllib3.connectionpool import HTTPConnection, VerifiedHTTPSConnection
from ..stubs import VCRHTTPConnection, VCRHTTPSConnection
# urllib3 defines its own HTTPConnection classes, which requests goes ahead and assumes