Skip to content

Commit

Permalink
Setup: prefer SNI Windows7 build on py3.8, non-7 on py3.9+
Browse files Browse the repository at this point in the history
  • Loading branch information
black-sliver committed Oct 25, 2024
1 parent d6247b8 commit 3d50d17
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ def download_SNI() -> None:
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:
Expand Down

0 comments on commit 3d50d17

Please sign in to comment.