Skip to content
Myr

remote read/close methods from response

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent c19b2c5 · Browse files · 1 file+1 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−10 removed

  • other:+1 added−10 removed

1 file+1 added−10 removed

modified:requests/models.py+1 added-10 removed
184 unmodified lines
185 response.status_code = getattr(resp, 'code', None)186187 try:188 response.headers = CaseInsensitiveDict(getattr(resp.info(), 'dict', None))189 response.read = resp.read189 response.fo = resp191 response._close = resp.close190191 if self.cookiejar:192193 response.cookies = dict_from_cookiejar(self.cookiejar)
246 unmodified lines
440 if self._content is not None:441 return self._content442443 # Read the contents.446 self._content = self.read()444 self._content = self.fo.read()445446 # Decode GZip'd content.447 if 'gzip' in self.headers.get('content-encoding', ''):448 try:
10 unmodified lines
459 else:460 raise AttributeError461462465463 def raise_for_status(self):464 """Raises stored :class:`HTTPError` or :class:`URLError`, if one occured."""465 if self.error:466 raise self.error467468472 def close(self):473 if self.fo.fp is not None and hasattr(self.fo.fp, '_sock'):474 self.fo.fp._sock.recv = None475 self._close()469477478470class AuthManager(object):471 """Requests Authentication Manager."""472473 def __new__(cls):
170 unmodified lines