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++");
if (!AnyStartsWith(flags, "-std"))
flags.push_back("-std=c++11");
flags.push_back("-resource_dir=" + GetDefaultResourceDirectory());
flags.push_back("-resource-dir=" + GetDefaultResourceDirectory());
if (had_extra_flags) {
std::cout << "For " << path << std::endl;
std::cout << " flags: " << StringJoin(flags) << std::endl;

12
wscript
View File

@ -2,9 +2,9 @@
# encoding: utf-8
try:
from urllib2 import urlopen # Python 2
from urllib2 import urlopen, URLError # Python 2
except ImportError:
from urllib.request import urlopen # Python 3
from urllib.request import urlopen, URLError # Python 3
import os.path
import string
@ -97,7 +97,13 @@ def download_and_extract(destdir, url, ext):
print(' destination: {0}'.format(dest))
print(' source: {0}'.format(url))
# 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:
f.write(response.read())
else: