This commit is contained in:
Chao Shen 2018-01-02 18:49:56 +08:00 committed by Jacob Dufault
parent a14ddc69ac
commit c157445ef3
2 changed files with 10 additions and 4 deletions

View File

@ -152,7 +152,7 @@ void RunIndexTests(const std::string& filter_path) {
flags.push_back("-xc++"); flags.push_back("-xc++");
if (!AnyStartsWith(flags, "-std")) if (!AnyStartsWith(flags, "-std"))
flags.push_back("-std=c++11"); flags.push_back("-std=c++11");
flags.push_back("-resource_dir=" + GetDefaultResourceDirectory()); flags.push_back("-resource-dir=" + GetDefaultResourceDirectory());
if (had_extra_flags) { if (had_extra_flags) {
std::cout << "For " << path << std::endl; std::cout << "For " << path << std::endl;
std::cout << " flags: " << StringJoin(flags) << std::endl; std::cout << " flags: " << StringJoin(flags) << std::endl;

12
wscript
View File

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