Consistent self.cookies usage
authorChris Adams <chris@improbable.org>
Sun, 29 Jan 2012 21:52:08 +0000 (16:52 -0500)
committerChris Adams <chris@improbable.org>
Sun, 29 Jan 2012 21:52:08 +0000 (16:52 -0500)
This avoids two variables pointing to the same thing and avoids
a duplicate dict update() call

requests/models.py

index 3f8547ef6e44a2993d6bcb93ada3ec93e3a37610..b4118b93828d98a7a76e3fc6ddc690a010473b1b 100644 (file)
@@ -203,7 +203,7 @@ class Request(object):
         history = []
 
         r = build(resp)
-        cookies = self.cookies
+
         self.cookies.update(r.cookies)
 
         if r.status_code in REDIRECT_STATI and not self.redirect:
@@ -247,7 +247,7 @@ class Request(object):
                     method=method,
                     params=self.session.params,
                     auth=self.auth,
-                    cookies=cookies,
+                    cookies=self.cookies,
                     redirect=True,
                     config=self.config,
                     timeout=self.timeout,
@@ -258,7 +258,6 @@ class Request(object):
                 )
 
                 request.send()
-                cookies.update(request.response.cookies)
                 r = request.response
                 self.cookies.update(r.cookies)