mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 19:06:37 +00:00
Name a non-list registry system field instead of a TypeError
file["system"] normalized None and str but let an int or dict fall through to the in test, where an int raises TypeError and a dict becomes a key test; both now raise the same Unexpected-response error as the other shape guards.
This commit is contained in:
@@ -109,6 +109,12 @@ def registry_download(package: str, version: str) -> tuple[str, str, int | None]
|
||||
systems = ["*"]
|
||||
elif isinstance(systems, str):
|
||||
systems = [systems]
|
||||
elif not isinstance(systems, list):
|
||||
# An int would make ``in`` a TypeError and a dict a key test
|
||||
raise EsphomeError(
|
||||
f"Unexpected package registry response for {package}: "
|
||||
f"{str(file)[:200]}"
|
||||
)
|
||||
if "*" in systems or systype in systems:
|
||||
sha256 = (file.get("checksum") or {}).get("sha256")
|
||||
if not sha256:
|
||||
|
||||
Reference in New Issue
Block a user