summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Gregorio <jcgregorio@google.com>2011-02-13 10:42:38 -0500
committerJoe Gregorio <jcgregorio@google.com>2011-02-13 10:42:38 -0500
commit4cc6bed93b6956dc6a69a384f301fa07e8f664b2 (patch)
tree0a21671543be14e48ba8ac4b9e58fc5019f6c1d1
parentb6c90c4cd431e213b7425f41b7c51f7dead51294 (diff)
downloadhttplib2-4cc6bed93b6956dc6a69a384f301fa07e8f664b2.tar.gz
Fixes issue 131. Handle socket.timeout's that occur during send.
-rw-r--r--Makefile2
-rw-r--r--python2/httplib2/__init__.py2
-rw-r--r--python3/httplib2/__init__.py2
3 files changed, 5 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a934692..0a010be 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
tests:
cd python2 && python2.4 httplib2test.py
- cd python2 && python2.5 httplib2test.py
+ -cd python2 && python2.5 httplib2test.py
cd python2 && python2.6 httplib2test.py
cd python3 && python3.1 httplib2test.py
diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py
index 2b4848f..c87010c 100644
--- a/python2/httplib2/__init__.py
+++ b/python2/httplib2/__init__.py
@@ -867,6 +867,8 @@ the same interface as FileCache."""
for i in range(2):
try:
conn.request(method, request_uri, body, headers)
+ except socket.timeout:
+ raise
except socket.gaierror:
conn.close()
raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
diff --git a/python3/httplib2/__init__.py b/python3/httplib2/__init__.py
index b25b9c8..07e05b4 100644
--- a/python3/httplib2/__init__.py
+++ b/python3/httplib2/__init__.py
@@ -848,6 +848,8 @@ the same interface as FileCache."""
for i in range(2):
try:
conn.request(method, request_uri, body, headers)
+ except socket.timeout:
+ raise
except socket.gaierror:
conn.close()
raise ServerNotFoundError("Unable to find the server at %s" % conn.host)