Skip to content

Commit

Permalink
added: Retry on httplib.HTTPException
Browse files Browse the repository at this point in the history
  • Loading branch information
starrify committed Apr 29, 2015
1 parent ab7b3b9 commit 1d7ae83
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scrapinghub.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
import time
import warnings

try:
# For Python 2
import httplib
except ImportError:
# For Python 3
import http.client as httplib

#python2 and python3 compatibility
try:
range = xrange
Expand Down Expand Up @@ -336,7 +343,7 @@ def items(self, offset=0, count=None, meta=None):
yield item
retrieved += 1
break
except (ValueError, socket.error, requests.RequestException) as exc:
except (ValueError, socket.error, requests.RequestException, httplib.HTTPException) as exc:
lastexc = exc
params['offset'] += retrieved
if 'count' in params:
Expand Down

0 comments on commit 1d7ae83

Please sign in to comment.