Helpers type hint improvements (#44964)
This commit is contained in:
parent
3569d92385
commit
3a88a4120e
4 changed files with 47 additions and 45 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue