Wrap botocore patching in tyr/except since we do not require it to be installed.

This commit is contained in:
Steve Pulec 2016-03-02 15:20:35 -05:00
parent 2e27e9edfb
commit 75a40e4571

View File

@ -33,7 +33,11 @@ from .route53 import mock_route53 # flake8: noqa
from .swf import mock_swf # flake8: noqa from .swf import mock_swf # flake8: noqa
# Need to monkey-patch botocore requests back to underlying urllib3 classes try:
from botocore.awsrequest import HTTPSConnectionPool, HTTPConnectionPool, HTTPConnection, VerifiedHTTPSConnection # Need to monkey-patch botocore requests back to underlying urllib3 classes
HTTPSConnectionPool.ConnectionCls = VerifiedHTTPSConnection from botocore.awsrequest import HTTPSConnectionPool, HTTPConnectionPool, HTTPConnection, VerifiedHTTPSConnection
HTTPConnectionPool.ConnectionCls = HTTPConnection except ImportError:
pass
else:
HTTPSConnectionPool.ConnectionCls = VerifiedHTTPSConnection
HTTPConnectionPool.ConnectionCls = HTTPConnection