diff options
author | ejochman <34144949+ejochman@users.noreply.github.com> | 2020-05-14 10:06:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 13:06:09 -0400 |
commit | 60ba0d9c958f6e03eb4760b219ca5797615b246d (patch) | |
tree | dd6c59a65877bee92606648d5bc0aa55a4f33be2 | |
parent | 02db277e2bbc5906c8787f64dc9a743fe3327f90 (diff) | |
download | apitools-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.py | 4 |
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( |