re raise last exception in windows
This commit is contained in:
@@ -69,16 +69,16 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef
|
|||||||
dest_dir = os.path.dirname(dest)
|
dest_dir = os.path.dirname(dest)
|
||||||
if not os.path.exists(dest_dir):
|
if not os.path.exists(dest_dir):
|
||||||
os.makedirs(dest_dir)
|
os.makedirs(dest_dir)
|
||||||
for _ in range(3):
|
repeat_num = 3
|
||||||
|
for i in range(repeat_num):
|
||||||
try:
|
try:
|
||||||
response = urlopen(url)
|
response = urlopen(url)
|
||||||
except:
|
except:
|
||||||
|
if i == repeat_num - 1:
|
||||||
|
raise
|
||||||
sleep(3)
|
sleep(3)
|
||||||
continue
|
continue
|
||||||
break
|
break
|
||||||
else:
|
|
||||||
print("Download from url " + url + "failed", file=sys.stderr)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(dest, 'wb') as file:
|
with open(dest, 'wb') as file:
|
||||||
|
|||||||
Reference in New Issue
Block a user