Helpers type hint improvements (#44964)

This commit is contained in:
Ville Skyttä 2021-01-09 01:08:34 +02:00 committed by GitHub
parent 3569d92385
commit 3a88a4120e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 45 deletions

View file

@ -556,7 +556,7 @@ def template(value: Optional[Any]) -> template_helper.Template:
template_value = template_helper.Template(str(value)) # type: ignore
try:
template_value.ensure_valid() # type: ignore[no-untyped-call]
template_value.ensure_valid()
return template_value
except TemplateError as ex:
raise vol.Invalid(f"invalid template ({ex})") from ex
@ -574,7 +574,7 @@ def dynamic_template(value: Optional[Any]) -> template_helper.Template:
template_value = template_helper.Template(str(value)) # type: ignore
try:
template_value.ensure_valid() # type: ignore[no-untyped-call]
template_value.ensure_valid()
return template_value
except TemplateError as ex:
raise vol.Invalid(f"invalid template ({ex})") from ex