From 3d8823cafc82fd9849eef6650a54a61554079b61 Mon Sep 17 00:00:00 2001 From: Yossi Gottlieb Date: Thu, 23 Oct 2014 13:46:44 +0300 Subject: [PATCH] Clean up handle_redirect. --- requests/auth.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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): -- 2.34.1