From: Cory Benfield Date: Sun, 24 Nov 2013 11:13:49 +0000 (+0000) Subject: Cleanup the redirect if blocks. X-Git-Tag: v2.1.0~15^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3369d87da96e38772faa773b755189320ab5b81c;p=services%2Fpython-requests.git Cleanup the redirect if blocks. --- diff --git a/requests/sessions.py b/requests/sessions.py index c0a0e85..9c95b58 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -113,13 +113,12 @@ class SessionRedirectMixin(object): # Do what the browsers do, despite standards... # First, turn 302s into GETs. - if (resp.status_code == codes.found and - method not in ('GET', 'HEAD')): + if resp.status_code == codes.found and method != 'HEAD': method = 'GET' # Second, if a POST is responded to with a 301, turn it into a GET. # This bizarre behaviour is explained in Issue 1704. - if (resp.status_code == codes.moved) and (method == 'POST'): + if resp.status_code == codes.moved and method == 'POST': method = 'GET' prepared_request.method = method