[travis] Retry. (#221)

This commit is contained in:
scturtle 2018-01-03 14:25:06 +08:00 committed by Fangrui Song
parent c8040a3b9e
commit f23a79b01d
2 changed files with 5 additions and 11 deletions

View File

@ -32,7 +32,7 @@ os: linux
cache:
directories:
- build/clang+llvm-5.0.1-x86_64-linux-gnu-ubuntu-14.04/
- build/clang+llvm-5.0.1-final-x86_64-apple-darwin/
- build/clang+llvm-5.0.1-x86_64-apple-darwin/
matrix:
fast_finish: true
@ -193,7 +193,7 @@ before_script:
- ${CXX} --version
script:
- ./waf configure
- travis_retry ./waf configure
- ./waf build
- ./build/release/bin/cquery --log-all-to-stderr --test-unit
- ./build/release/bin/cquery --log-all-to-stderr --test-index

10
wscript
View File

@ -2,9 +2,9 @@
# encoding: utf-8
try:
from urllib2 import urlopen, URLError # Python 2
from urllib2 import urlopen # Python 2
except ImportError:
from urllib.request import urlopen, URLError # Python 3
from urllib.request import urlopen # Python 3
import os.path
import string
@ -100,13 +100,7 @@ def download_and_extract(destdir, url, ext):
print(' destination: {0}'.format(dest))
print(' source: {0}'.format(url))
# TODO: verify checksum
for _ in range(5):
try:
response = urlopen(url, timeout=60)
break
except URLError:
print('Retry')
continue
with open(dest, 'wb') as f:
f.write(response.read())
else: