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

@@ -64,9 +64,11 @@ def fetch_official_launcher(
try:
response = urlopen(request, timeout=timeout_seconds)
except HTTPError as exc:
if exc.code == 304 and destination.is_file():
status = exc.code
exc.close()
if status == 304 and destination.is_file():
return _existing_download(destination, metadata, url)
raise DownloadError(f"official launcher request failed: HTTP {exc.code}") from exc
raise DownloadError(f"official launcher request failed: HTTP {status}") from exc
except OSError as exc:
raise DownloadError(f"official launcher request failed: {exc}") from exc