diff --git a/setup.py b/setup.py index e3c050a23561..401cc7fa5bda 100644 --- a/setup.py +++ b/setup.py @@ -105,11 +105,13 @@ def download_SNI(): download_url: str = file["browser_download_url"] machine_match = download_url.rsplit("-", 1)[1].split(".", 1)[0] == machine_name if platform_name in download_url and machine_match: + source_url = download_url # prefer "many" builds if "many" in download_url: - source_url = download_url break - source_url = download_url + # prefer the correct windows or windows7 build + if platform_name == "windows" and ("windows7" in download_url) == (sys.version_info < (3, 9)): + break if source_url and source_url.endswith(".zip"): with urllib.request.urlopen(source_url) as download: