From d0b2552cb2aadfa47294a853af1e428a667d8691 Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro Dantas Date: Sat, 11 Apr 2020 23:07:18 +0200 Subject: [PATCH] don't set http.redirect_codes if the attr doesn't exist The http.redirect_codes attribute does not exist in old versions of httplib2. --- pydrive2/auth.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pydrive2/auth.py b/pydrive2/auth.py index 77107095..a8810c83 100644 --- a/pydrive2/auth.py +++ b/pydrive2/auth.py @@ -586,7 +586,12 @@ def _build_http(self): # This asks httplib2 to exclude 308s from the status codes # it treats as redirects # See also: https://stackoverflow.com/a/59850170/298182 - http.redirect_codes = http.redirect_codes - {308} + try: + http.redirect_codes = http.redirect_codes - {308} + except AttributeError: + # http.redirect_codes does not exist in previous versions + # of httplib2, so pass + pass return http def Authorize(self):