From 597f0ae5fd2bf512737d022b8bc9f908657c47fc Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 13 Oct 2011 20:47:58 -0400 Subject: [PATCH] Catch raw socket errors --- requests/models.py | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.7.4