summaryrefslogtreecommitdiff
path: root/python2
diff options
context:
space:
mode:
authorJoe Gregorio <joe@bitworking.org>2015-09-21 13:35:36 -0400
committerJoe Gregorio <joe@bitworking.org>2015-09-21 13:35:36 -0400
commitd86146d57ba65a36700f14201fe724f320504a4e (patch)
tree6a958c8617769a02c87be748649af60d0f008690 /python2
parentf69fe23a71ac58bde912af87dabf3057c4cd3c76 (diff)
parent7ebbd4334d0a78b6b869729b7cbf19fd7ce98037 (diff)
downloadhttplib2-d86146d57ba65a36700f14201fe724f320504a4e.tar.gz
Merge pull request #313 from ccstolley/master
Fix incorrect ResponseNotReady exceptions, retry on transient errors.
Diffstat (limited to 'python2')
-rw-r--r--python2/httplib2/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py
index 19e7cff..f0d17a1 100644
--- a/python2/httplib2/__init__.py
+++ b/python2/httplib2/__init__.py
@@ -1285,8 +1285,9 @@ class Http(object):
err = getattr(e, 'args')[0]
else:
err = e.errno
- if err == errno.ECONNREFUSED: # Connection refused
- raise
+ if err in (errno.ENETUNREACH, errno.EADDRNOTAVAIL) and i < RETRIES:
+ continue # retry on potentially transient socket errors
+ raise
except httplib.HTTPException:
# Just because the server closed the connection doesn't apparently mean
# that the server didn't send a response.