Fix shadowing of outer name in config_validation (#82088)

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
Aarni Koskela 2022-11-16 15:04:57 +02:00 committed by GitHub
parent 987b840665
commit 4f7b583f19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -914,9 +914,9 @@ def key_value_schemas(
with contextlib.suppress(vol.Invalid):
return cast(dict[Hashable, Any], default_schema(value))
alternatives = ", ".join(str(key) for key in value_schemas)
alternatives = ", ".join(str(alternative) for alternative in value_schemas)
if default_description:
alternatives += ", " + default_description
alternatives = f"{alternatives}, {default_description}"
raise vol.Invalid(
f"Unexpected value for {key}: '{key_value}'. Expected {alternatives}"
)