Code cleanup and improvements.

This commit is contained in:
2026-09-03 21:52:06 +02:00
parent ea323e3ab0
commit ecdea827ac
20 changed files with 312 additions and 213 deletions

View File

@@ -603,7 +603,9 @@ def _fetch_small_file(
try:
response = urlopen(request, timeout=timeout_seconds)
except HTTPError as exc:
raise LauncherUpdateError(f"{label} request failed: HTTP {exc.code}") from exc
status = exc.code
exc.close()
raise LauncherUpdateError(f"{label} request failed: HTTP {status}") from exc
except (URLError, OSError) as exc:
raise LauncherUpdateError(f"{label} request failed: {exc}") from exc
with response:
@@ -695,8 +697,10 @@ def _download_archive(
try:
response = urlopen(request, timeout=timeout_seconds)
except HTTPError as exc:
status = exc.code
exc.close()
raise LauncherUpdateError(
f"launcher archive request failed: HTTP {exc.code}"
f"launcher archive request failed: HTTP {status}"
) from exc
except (URLError, OSError) as exc:
raise LauncherUpdateError(f"launcher archive request failed: {exc}") from exc