Skip to content
Myr

Catch raw socket errors

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 565745f · Browse files · 1 file+2 added−0 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+2 added−0 removed

  • other:+2 added−0 removed

1 file+2 added−0 removed

modified:requests/models.py+2 added
359 unmodified lines
360 except (urllib2.HTTPError, urllib2.URLError), why:361 if hasattr(why, 'reason'):362 if isinstance(why.reason, socket.timeout):363 why = Timeout(why)364 elif isinstance(why.reason, socket.error):365 why = Timeout(why)366367 self._build_response(why, is_error=True)368369
254 unmodified lines