From: Yossi Gottlieb Date: Thu, 23 Oct 2014 10:46:44 +0000 (+0300) Subject: Clean up handle_redirect. X-Git-Tag: v2.5.0~13^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d8823cafc82fd9849eef6650a54a61554079b61;p=services%2Fpython-requests.git Clean up handle_redirect. --- diff --git a/requests/auth.py b/requests/auth.py index b2b341f..010919f 100644 --- a/requests/auth.py +++ b/requests/auth.py @@ -153,9 +153,7 @@ class HTTPDigestAuth(AuthBase): def handle_redirect(self, r, **kwargs): """Reset num_401_calls counter on redirects.""" - if r.status_code in ( - codes.temporary_redirect, - codes.permanent_redirect): + if r.is_redirect: setattr(self, 'num_401_calls', 1) def handle_401(self, r, **kwargs):