Skip to content
Myr

Safer error response handling.

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 68dea92 · Browse files · 1 file+3 added−3 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+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:requests/core.py+3 added-3 removed
132 unmodified lines
133134 def _build_response(self, resp):135 """Build internal Response object from given response."""136 137 self.response.status_code = resp.code138 self.response.headers = resp.info().dict137 self.response.status_code = getattr(resp, 'code', None)138 self.response.headers = getattr(resp.info(), 'dict', None)139 self.response.url = getattr(resp, 'url', None)140 self.response.content = resp.read()140 self.response.url = resp.url141142 143 def send(self, anyway=False):144 """Sends the request. Returns True of successful, false if not.
290 unmodified lines