history is a tuple, not list

This commit is contained in:
Kenneth Reitz
2012-12-17 02:32:19 -05:00
parent 0d183c41a9
commit d5572ac13f
+4 -5
View 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.