Update sessions.py
Made removing a key-value pair more modular
Remove unneeeded return statement
@@ -201,10 +201,7 @@ class SessionRedirectMixin(object):
prepared_request.body = None
headers = prepared_request.headers
- try:
- del headers['Cookie']
- except KeyError:
- pass
+ headers.pop('Cookie', None)
# Extract any cookies sent on the response to the cookiejar
# in the new request. Because we've mutated our copied prepared
@@ -271,7 +268,6 @@ class SessionRedirectMixin(object):
if new_auth is not None:
prepared_request.prepare_auth(new_auth)
- return
def rebuild_proxies(self, prepared_request, proxies):
"""This method re-evaluates the proxy configuration by considering the
