Skip to content

Instantly share code, notes, and snippets.

@mhrivnak
Last active August 28, 2015 15:50
Show Gist options
  • Save mhrivnak/e94274107575b39f6cf1 to your computer and use it in GitHub Desktop.
Save mhrivnak/e94274107575b39f6cf1 to your computer and use it in GitHub Desktop.
response = None
for x in range(self.retries + 1):
try:
response = session.get(
request.url, headers=headers, timeout=(self.config.connect_timeout,
self.config.read_timeout)
)
except httplib.BadStatusLine:
continue
if response is None:
raise DownloadFailed()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment