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) |