Skip to content

Instantly share code, notes, and snippets.

@jonbinney
Created June 2, 2013 23:21
Show Gist options
  • Select an option

  • Save jonbinney/5695321 to your computer and use it in GitHub Desktop.

Select an option

Save jonbinney/5695321 to your computer and use it in GitHub Desktop.
Test downloading rosdep sources from github.
import urllib2
import time
DOWNLOAD_TIMEOUT=15.0
while True:
try:
url = 'https://github.com/ros/rosdistro/raw/master/rosdep/gentoo.yaml'
f = urllib2.urlopen(url, timeout=DOWNLOAD_TIMEOUT)
print 'Download successful'
except Exception as e:
print 'Error: %d' % e.code
f = open('error_page_%s.html' % int(time.time()), 'w+')
f.write(e.read())
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment