projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
55237ad
)
Catch socket.gaierror in safe mode.
author
Cory Benfield
<lukasaoz@gmail.com>
Thu, 2 Aug 2012 11:16:41 +0000
(12:16 +0100)
committer
Cory Benfield
<lukasaoz@gmail.com>
Thu, 2 Aug 2012 11:16:41 +0000
(12:16 +0100)
requests/safe_mode.py
patch
|
blob
|
history
diff --git
a/requests/safe_mode.py
b/requests/safe_mode.py
index 619d368c7fa9ac79889b1e4a278f8c986f8c6a26..cd171f7d6441f6a076cb23336e8be1aaf23dba42 100644
(file)
--- a/
requests/safe_mode.py
+++ b/
requests/safe_mode.py
@@
-28,7
+28,8
@@
def catch_exceptions_if_in_safe_mode(function):
and kwargs.get('session').config.get('safe_mode')):
try:
return function(method, url, **kwargs)
- except (RequestException, ConnectionError, HTTPError, socket.timeout) as e:
+ except (RequestException, ConnectionError, HTTPError,
+ socket.timeout, socket.gaierror) as e:
r = Response()
r.error = e
r.raw = HTTPResponse() # otherwise, tests fail