Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't set http.redirect_codes if the attr doesn't exist #841

Merged
merged 7 commits into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion googleapiclient/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,13 @@ def build_http():
# for Resumable Uploads rather than Permanent Redirects.
# This asks httplib2 to exclude 308s from the status codes
# it treats as redirects
http.redirect_codes = http.redirect_codes - {308}
try:
http.redirect_codes = http.redirect_codes - {308}
except AttributeError:
# Apache Beam tests depend on this library and cannot
# currently upgrade their httplib2 version
# http.redirect_codes does not exist in previous versions
# of httplib2, so pass
pass

return http
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
packages = ["apiclient", "googleapiclient", "googleapiclient/discovery_cache"]

install_requires = [
"httplib2>=0.17.0,<1dev",
"httplib2>=0.9.2,<1dev",
busunkim96 marked this conversation as resolved.
Show resolved Hide resolved
"google-auth>=1.4.1",
"google-auth-httplib2>=0.0.3",
"google-api-core>=1.13.0,<2dev",
Expand Down