diff options
author | csharp@chromium.org <csharp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 17:00:50 +0000 |
---|---|---|
committer | csharp@chromium.org <csharp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 17:00:50 +0000 |
commit | 576e7fbf456a16a203e796d8c20a364abc0b065e (patch) | |
tree | 83ebfb6da0a0cf38de60c13016e64d54c75c491b /tools | |
parent | 7599f4cc4105a86f94881e78ddf81b37fed528f4 (diff) | |
download | chromium_src-576e7fbf456a16a203e796d8c20a364abc0b065e.zip chromium_src-576e7fbf456a16a203e796d8c20a364abc0b065e.tar.gz chromium_src-576e7fbf456a16a203e796d8c20a364abc0b065e.tar.bz2 |
Update run_test_from_archive.py to handle 404
Update run_test_from_archieve.py to check if a url is valid before downloading it to prevent grabbing files that are just 404s.
BUG=
TEST=
Review URL: http://codereview.chromium.org/10187007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133709 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/isolate/run_test_from_archive.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/isolate/run_test_from_archive.py b/tools/isolate/run_test_from_archive.py index 2c56bc8..2223908 100755 --- a/tools/isolate/run_test_from_archive.py +++ b/tools/isolate/run_test_from_archive.py @@ -117,7 +117,10 @@ def open_remote(file_or_url): def download_or_copy(file_or_url, dest): """Copies a file or download an url.""" if re.match(r'^https?://.+$', file_or_url): - urllib.urlretrieve(file_or_url, dest) + try: + urllib.URLopener().retrieve(file_or_url, dest) + except IOError: + logging.error('Failed to download ' + file_or_url) else: shutil.copy(file_or_url, dest) |