aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorejochman <34144949+ejochman@users.noreply.github.com>2020-05-14 10:06:09 -0700
committerGitHub <noreply@github.com>2020-05-14 13:06:09 -0400
commit60ba0d9c958f6e03eb4760b219ca5797615b246d (patch)
treedd6c59a65877bee92606648d5bc0aa55a4f33be2
parent02db277e2bbc5906c8787f64dc9a743fe3327f90 (diff)
downloadapitools-60ba0d9c958f6e03eb4760b219ca5797615b246d.tar.gz
Add compatibility with httplib2 0.16.0+ (#295)
See more at googleapis/google-api-python-client#803. Fix applied as recommended in https://github.com/googleapis/google-api-python-client/issues/803#issuecomment-578151576
-rw-r--r--apitools/base/py/http_wrapper.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/apitools/base/py/http_wrapper.py b/apitools/base/py/http_wrapper.py
index a3fe65c..c31bea0 100644
--- a/apitools/base/py/http_wrapper.py
+++ b/apitools/base/py/http_wrapper.py
@@ -339,6 +339,10 @@ def MakeRequest(http, http_request, retries=7, max_retry_wait=60,
"""
retry = 0
first_req_time = time.time()
+ # Provide compatibility for breaking change in httplib2 0.16.0+:
+ # https://github.com/googleapis/google-api-python-client/issues/803
+ if hasattr(http, 'redirect_codes'):
+ http.redirect_codes = set(http.redirect_codes) - {308}
while True:
try:
return _MakeRequestNoRetry(