Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: tools/isolate/run_test_from_archive.py

Issue 10187007: Update run_test_from_archive.py to handle 404 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/isolate/run_test_from_archive.py
diff --git a/tools/isolate/run_test_from_archive.py b/tools/isolate/run_test_from_archive.py
index 2c56bc823384322c5dc06c5b6c0f046b81f2ff00..dc4540f66df0dbc88750553580775256612860de 100755
--- a/tools/isolate/run_test_from_archive.py
+++ b/tools/isolate/run_test_from_archive.py
@@ -117,7 +117,14 @@ 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)
+ remote_file = urllib.urlopen(file_or_url)
Marc-Antoine Ruel (Google) 2012/04/23 23:50:14 I'd prefer to keep using urlretrieve(). Albeit it'
+ if remote_file.getcode() != 200:
+ logging.error('Failed to download ' + file_or_url)
+ return
+
+ f = open(dest, 'wb')
+ f.write(remote_file.read())
+ f.close()
else:
shutil.copy(file_or_url, dest)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698