history is a tuple, not list
authorKenneth Reitz <me@kennethreitz.com>
Mon, 17 Dec 2012 07:32:19 +0000 (02:32 -0500)
committerKenneth Reitz <me@kennethreitz.com>
Mon, 17 Dec 2012 07:32:19 +0000 (02:32 -0500)
requests/sessions.py

index 23e463121f471336899cfcee950a4d61d58e708f..788e4a7556233a52e3b618f6b7822944ea874683 100644 (file)
@@ -253,24 +253,23 @@ class Session(SessionMixin):
 
         resp = self.send(prep)
 
-        # Redirect generator.
+        # Redirect resolving generator.
         gen = self.resolve_redirects(resp, req, prefetch, timeout, verify, cert)
 
+        # Resolve redirects if allowed.
         history = [r for r in gen] if allow_redirects else []
 
+        # Shuffle things around if there's history.
         if history:
             history.insert(0, resp)
             resp = history.pop()
-            resp.history = history
+            resp.history = tuple(history)
 
         return resp
 
 
 
 
-
-
-
     def get(self, url, **kwargs):
         """Sends a GET request. Returns :class:`Response` object.