diff --git a/studio/install_llama_prebuilt.py b/studio/install_llama_prebuilt.py index 792176bf29..8b979b092d 100644 --- a/studio/install_llama_prebuilt.py +++ b/studio/install_llama_prebuilt.py @@ -1150,7 +1150,8 @@ def _resolve_latest_release_tag_via_redirect(repo: str) -> str | None: """ class _NoFollowRedirect(urllib.request.HTTPRedirectHandler): - def redirect_request(self, *args, **kwargs): # type: ignore[override] + def redirect_request(self, req, fp, code, msg, headers, newurl): + # Never follow the redirect; read the tag from the 3xx Location. return None url = f"https://github.com/{repo}/releases/latest" diff --git a/tests/studio/install/test_tokenless_release_resolution.py b/tests/studio/install/test_tokenless_release_resolution.py index 989dd7a109..2b824859fd 100644 --- a/tests/studio/install/test_tokenless_release_resolution.py +++ b/tests/studio/install/test_tokenless_release_resolution.py @@ -16,9 +16,11 @@ STUDIO_DIR = ROOT / "studio" if str(STUDIO_DIR) not in sys.path: sys.path.insert(0, str(STUDIO_DIR)) -import install_llama_prebuilt as MOD # noqa: E402 +import install_llama_prebuilt as INSTALL_LLAMA_PREBUILT # noqa: E402 from install_llama_prebuilt import HostInfo # noqa: E402 +MOD = INSTALL_LLAMA_PREBUILT + def _host(**overrides) -> HostInfo: base = dict(