From: Kenneth Reitz Date: Fri, 14 Oct 2011 00:47:58 +0000 (-0400) Subject: Catch raw socket errors X-Git-Tag: v0.6.5~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=597f0ae5fd2bf512737d022b8bc9f908657c47fc;p=services%2Fpython-requests.git Catch raw socket errors --- diff --git a/requests/models.py b/requests/models.py index b3a60c2..8d044d5 100644 --- a/requests/models.py +++ b/requests/models.py @@ -361,6 +361,8 @@ class Request(object): if hasattr(why, 'reason'): if isinstance(why.reason, socket.timeout): why = Timeout(why) + elif isinstance(why.reason, socket.error): + why = Timeout(why) self._build_response(why, is_error=True)