From e65360dbaf252a136a011adf639e5dce880a2412 Mon Sep 17 00:00:00 2001 From: exvito Date: Thu, 2 Apr 2015 21:29:51 +0100 Subject: [PATCH] Issue #2334 - HTTPDigestAuth - Replace getattr utilization Following Lukasa + kennethreitz suggestion. --- requests/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/auth.py b/requests/auth.py index 289da366..5c5332c8 100644 --- a/requests/auth.py +++ b/requests/auth.py @@ -167,7 +167,7 @@ class HTTPDigestAuth(AuthBase): # Rewind the file position indicator of the body to where # it was to resend the request. r.request.body.seek(self.pos) - num_401_calls = getattr(self.num_401_calls, 'value', 1) + num_401_calls = self.num_401_calls.value s_auth = r.headers.get('www-authenticate', '') if 'digest' in s_auth.lower() and num_401_calls < 2: