Skip to content

Commit e3cb9d4

Browse files
Moutixgarrettheel
authored andcommitted
Fix botocore > 1.11.0 compatibility for proxies (pynamodb#531)
1 parent ed7f205 commit e3cb9d4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pynamodb/connection/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,15 @@ def _make_api_call(self, operation_name, operation_kwargs):
351351

352352
response = None
353353
try:
354+
proxies = getattr(self.client._endpoint, "proxies", None)
355+
# After the version 1.11.0 of botocore this field is no longer available here
356+
if proxies is None:
357+
proxies = self.client._endpoint.http_session._proxy_config._proxies
358+
354359
response = self.requests_session.send(
355360
prepared_request,
356361
timeout=self._request_timeout_seconds,
357-
proxies=self.client._endpoint.proxies,
362+
proxies=proxies,
358363
)
359364
data = response.json()
360365
except (requests.RequestException, ValueError) as e:

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# we didn't want to bump the actual dependency of the library for consumers as it would effectively
77
# be a breaking change. As a result, we use the 1.6.0 dependency for development here for the
88
# purpose of integration tests, even though requirements.txt still has 1.2.0.
9-
botocore==1.6.0
9+
botocore==1.11.4
1010
six==1.9.0
1111
coverage==3.7.1
1212
mock==2.0.0

0 commit comments

Comments
 (0)