Skip to content

Commit

Permalink
Merge pull request psf#751 from Lukasa/develop
Browse files Browse the repository at this point in the history
Catch socket.gaierror in safe mode.
  • Loading branch information
Kenneth Reitz committed Aug 2, 2012
2 parents 22179c4 + 4f40b3b commit 664880d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion requests/safe_mode.py
Expand Up @@ -28,7 +28,8 @@ def wrapped(method, url, **kwargs):
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
Expand Down

0 comments on commit 664880d

Please sign in to comment.