diff options
author | Joe Gregorio <jcgregorio@google.com> | 2011-06-13 13:09:20 -0400 |
---|---|---|
committer | Joe Gregorio <jcgregorio@google.com> | 2011-06-13 13:09:20 -0400 |
commit | dcc062fcb9c3eeac045471919b017e70a258e217 (patch) | |
tree | f52e5130bf158511f7fc2326b8a8b184f3d89fba | |
parent | e70941446da5b8a9953f85215054c8009f321208 (diff) | |
download | httplib2-dcc062fcb9c3eeac045471919b017e70a258e217.tar.gz |
Fixes issue 145.
-rw-r--r-- | python2/httplib2/__init__.py | 2 | ||||
-rw-r--r-- | python3/httplib2/__init__.py | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py index fb090a9..39d817f 100644 --- a/python2/httplib2/__init__.py +++ b/python2/httplib2/__init__.py @@ -911,6 +911,8 @@ class HTTPSConnectionWithTimeout(httplib.HTTPSConnection): raise SSLHandshakeError(e) else: raise + except (socket.timeout, socket.gaierror): + raise except socket.error, msg: if self.debuglevel > 0: print 'connect fail:', (self.host, self.port) diff --git a/python3/httplib2/__init__.py b/python3/httplib2/__init__.py index a53723b..c5ab677 100644 --- a/python3/httplib2/__init__.py +++ b/python3/httplib2/__init__.py @@ -895,6 +895,8 @@ the same interface as FileCache.""" pass try: response = conn.getresponse() + except socket.timeout: + raise except (socket.error, http.client.HTTPException): conn.close() if i == 0: |