Studio: tidy redirect handler signature and align test import (PR #5886)
This commit is contained in:
parent
89127970fa
commit
bbec4f6deb
2 changed files with 5 additions and 2 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue