From: Kenneth Reitz Date: Mon, 20 Feb 2012 18:46:54 +0000 (-0500) Subject: allow 3XX in danger_mode X-Git-Tag: v0.10.3~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c55d269ce87d405c1bafbbcdc797c62a401167d;p=services%2Fpython-requests.git allow 3XX in danger_mode --- diff --git a/requests/models.py b/requests/models.py index 6ee6831..2c0b2e0 100644 --- a/requests/models.py +++ b/requests/models.py @@ -773,13 +773,13 @@ class Response(object): return content - def raise_for_status(self): + def raise_for_status(self, allow_redirects=True): """Raises stored :class:`HTTPError` or :class:`URLError`, if one occurred.""" if self.error: raise self.error - if (self.status_code >= 300) and (self.status_code < 400) and not self.rquest.allow_redirects: + if (self.status_code >= 300) and (self.status_code < 400) and not allow_redirects: raise HTTPError('%s Redirection' % self.status_code) elif (self.status_code >= 400) and (self.status_code < 500):