Skip to content

Commit

Permalink
fo => raw
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Reitz committed Oct 14, 2011
1 parent 030d877 commit 573ab09
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions requests/models.py
Expand Up @@ -189,7 +189,7 @@ def build(resp):

try:
response.headers = CaseInsensitiveDict(getattr(resp.info(), 'dict', None))
response.fo = resp
response.raw = resp

if self.cookiejar:
response.cookies = dict_from_cookiejar(self.cookiejar)
Expand Down Expand Up @@ -217,7 +217,7 @@ def build(resp):
((r.status_code is codes.see_other) or (self.allow_redirects))
):

r.fo.close()
r.raw.close()

if not len(history) < settings.max_redirects:
raise TooManyRedirects()
Expand Down Expand Up @@ -407,7 +407,7 @@ def __init__(self):
self.headers = CaseInsensitiveDict()

#: File-like object representation of response (for advanced usage).
self.fo = None
self.raw = None

#: Final URL location of Response.
self.url = None
Expand Down Expand Up @@ -451,7 +451,7 @@ def iter_content(self, chunk_size=10 * 1024, decode_unicode=None):

def generate():
while 1:
chunk = self.fo.read(chunk_size)
chunk = self.raw.read(chunk_size)
if not chunk:
break
yield chunk
Expand Down Expand Up @@ -479,7 +479,7 @@ def content(self):
'already consumed')

# Read the contents.
self._content = self.fo.read()
self._content = self.raw.read()

# Decode GZip'd content.
if 'gzip' in self.headers.get('content-encoding', ''):
Expand Down

0 comments on commit 573ab09

Please sign in to comment.