Created
June 2, 2013 23:21
-
-
Save jonbinney/5695321 to your computer and use it in GitHub Desktop.
Test downloading rosdep sources from github.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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