From b8bd389a25f7ab6d114fea1ab678cd90a44513b7 Mon Sep 17 00:00:00 2001 From: "Nathaniel J. Smith" Date: Sat, 3 Jul 2021 13:49:26 -0700 Subject: [PATCH] Use correct URL for fetching prerelease builds --- locallibs/get.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locallibs/get.py b/locallibs/get.py index 5c6fd5f..41f980e 100644 --- a/locallibs/get.py +++ b/locallibs/get.py @@ -22,6 +22,7 @@ import subprocess import sys import tempfile +import re CURL = "/usr/bin/curl" DITTO = "/usr/bin/ditto" @@ -29,6 +30,9 @@ DEFAULT_BASEURL = "https://www.python.org/ftp/python/%s/python-%s-macosx%s.pkg" DEFAULT_PYTHON_VERSION = "2.7.15" DEFAULT_OS_VERSION = "10.9" +# The version "3.10b1" is fetched from the directory "3.10" +# This regex lets you convert 3.10b1 -> 3.10 +BASE_VERSION_RE = re.compile(r"^[0-9]+\.[0-9]+(\.[0-9]+)") class FrameworkGetter(object): @@ -64,7 +68,7 @@ def download(self): else: base_url = self.base_url url = base_url % ( - self.python_version, + BASE_VERSION_RE.match(self.python_version).group(0), self.python_version, self.os_version, )