From ba485913b624d997675760120abd6da2e6d69a34 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Wed, 30 Jan 2013 10:58:32 -0500 Subject: [PATCH] Thanks to @maxcountryman for the code review --- requests/sessions.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/requests/sessions.py b/requests/sessions.py index c2eebac..633d138 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -367,12 +367,8 @@ class Session(SessionRedirectMixin): """Send a given PreparedRequest.""" # Set up variables needed for resolve_redirects and dispatching of # hooks - allow_redirects = True - if 'allow_redirects' in kwargs: - allow_redirects = kwargs.pop('allow_redirects') - req = None - if 'req' in kwargs: - req = kwargs.pop('req') + allow_redirects = kwargs.pop('allow_redirects', True) + req = kwargs.pop('req', None) stream = kwargs.get('stream', False) timeout = kwargs.get('timeout') verify = kwargs.get('verify') -- 2.7.4