From a970e7cc40a3d405bef416a414a291eacd982901 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:53:50 +0200 Subject: [PATCH] Setup: prefer SNI Windows7 build on py3.8, non-7 on py3.9+ --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e3c050a23561..32a2503e8cdf 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: