diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index 3bd0df79..ffea3163 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -1,4 +1,5 @@ from __future__ import print_function +from time import sleep import tempfile import os, subprocess, shlex, sys, shutil from collections import namedtuple @@ -50,7 +51,14 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef return subprocess.check_call(args, env=env, cwd=cwd, shell=shell) # get latest pip once and for all - call(['curl', '-L', '-o', get_pip_script, get_pip_url]) + for _ in range(10): + try: + call(['curl', '-L', '-o', get_pip_script, get_pip_url]) + except subprocess.CalledProcessError: + sleep(3) + continue + break + assert os.path.exists(get_pip_script) for config in python_configurations: # if this version of python isn't installed, get it from python.org and install diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 7c03f815..56561fba 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -1,5 +1,6 @@ from __future__ import print_function import os, tempfile, subprocess, shutil, sys +from time import sleep from collections import namedtuple from glob import glob @@ -96,7 +97,15 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef download('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', nuget) # get pip fo this installation which not have. get_pip_script = 'C:\\cibw\\get-pip.py' - download('https://bootstrap.pypa.io/get-pip.py', get_pip_script) + + for _ in range(10): + try: + download('https://bootstrap.pypa.io/get-pip.py', get_pip_script) + except: + sleep(3) + continue + break + assert os.path.exists(get_pip_script) python_configurations = get_python_configurations(build_selector) for config in python_configurations: