Upgrade mypy to 0.790 (#41595)

This commit is contained in:
Ville Skyttä 2020-10-13 03:17:30 +03:00 committed by GitHub
parent 1417a4161f
commit f28c3273c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 16 additions and 13 deletions

View file

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