Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a480d53

Browse files
authored
fix: don't set http.redirect_codes if the attr doesn't exist and allow more httplib2 versions (googleapis#841)
* fix: don't set http.redirect_codes if the attr doesn't exist * fix: widen permitted httplib2 versions
1 parent 1cf3cbc commit a480d53

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

googleapiclient/http.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,13 @@ def build_http():
18911891
# for Resumable Uploads rather than Permanent Redirects.
18921892
# This asks httplib2 to exclude 308s from the status codes
18931893
# it treats as redirects
1894-
http.redirect_codes = http.redirect_codes - {308}
1894+
try:
1895+
http.redirect_codes = http.redirect_codes - {308}
1896+
except AttributeError:
1897+
# Apache Beam tests depend on this library and cannot
1898+
# currently upgrade their httplib2 version
1899+
# http.redirect_codes does not exist in previous versions
1900+
# of httplib2, so pass
1901+
pass
18951902

18961903
return http

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
packages = ["apiclient", "googleapiclient", "googleapiclient/discovery_cache"]
3434

3535
install_requires = [
36-
"httplib2>=0.17.0,<1dev",
36+
# NOTE: Apache Beam tests depend on this library and cannot
37+
# currently upgrade their httplib2 version.
38+
# Please see https://github.com/googleapis/google-api-python-client/pull/841
39+
"httplib2>=0.9.2,<1dev",
3740
"google-auth>=1.4.1",
3841
"google-auth-httplib2>=0.0.3",
3942
"google-api-core>=1.13.0,<2dev",

0 commit comments

Comments
 (0)