diff options
author | Joe Gregorio <jcgregorio@google.com> | 2013-03-26 14:17:48 -0400 |
---|---|---|
committer | Joe Gregorio <jcgregorio@google.com> | 2013-03-26 14:17:48 -0400 |
commit | aca2be6e1b387e9720ad960ef1f2bb3b5f5d745c (patch) | |
tree | 8c2ecfeb1e3823429ff80167e5e153caf0c1f95e /python2 | |
parent | 1d3a7099b0e8b9a2dc62e59bf9c3deac55087ac6 (diff) | |
download | httplib2-aca2be6e1b387e9720ad960ef1f2bb3b5f5d745c.tar.gz |
Pass method by name, not positionally.
Fixes issue #252.
Reviewed in https://codereview.appspot.com/7987046/.
Diffstat (limited to 'python2')
-rw-r--r-- | python2/httplib2/__init__.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py index 191ef1e..8e9f0fe 100644 --- a/python2/httplib2/__init__.py +++ b/python2/httplib2/__init__.py @@ -1380,7 +1380,10 @@ class Http(object): if response.status in [302, 303]: redirect_method = "GET" body = None - (response, content) = self.request(location, redirect_method, body=body, headers = headers, redirections = redirections - 1) + (response, content) = self.request( + location, method=redirect_method, + body=body, headers=headers, + redirections=redirections - 1) response.previous = old_response else: raise RedirectLimit("Redirected more times than rediection_limit allows.", response, content) @@ -1522,7 +1525,9 @@ class Http(object): # Should cached permanent redirects be counted in our redirection count? For now, yes. if redirections <= 0: raise RedirectLimit("Redirected more times than rediection_limit allows.", {}, "") - (response, new_content) = self.request(info['-x-permanent-redirect-url'], "GET", headers = headers, redirections = redirections - 1) + (response, new_content) = self.request( + info['-x-permanent-redirect-url'], method='GET', + headers=headers, redirections=redirections - 1) response.previous = Response(info) response.previous.fromcache = True else: |