diff --git a/homeassistant/components/renault/entity.py b/homeassistant/components/renault/entity.py index 10de028b2d0..c7f83c1e6f2 100644 --- a/homeassistant/components/renault/entity.py +++ b/homeassistant/components/renault/entity.py @@ -60,5 +60,5 @@ class RenaultDataEntity( def _get_data_attr(self, key: str) -> StateType: """Return the attribute value from the coordinator data.""" if self.coordinator.data is None: - return None # type: ignore[unreachable] + return None return cast(StateType, getattr(self.coordinator.data, key)) diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index 57587dc21d6..5b4a48bb07c 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -23,7 +23,16 @@ import statistics from struct import error as StructError, pack, unpack_from import sys from types import CodeType, TracebackType -from typing import Any, Concatenate, Literal, NoReturn, Self, cast, overload +from typing import ( + TYPE_CHECKING, + Any, + Concatenate, + Literal, + NoReturn, + Self, + cast, + overload, +) from urllib.parse import urlencode as urllib_urlencode import weakref @@ -88,6 +97,9 @@ from .singleton import singleton from .translation import async_translate_state from .typing import TemplateVarsType +if TYPE_CHECKING: + from _typeshed import OptExcInfo + # mypy: allow-untyped-defs, no-check-untyped-defs _LOGGER = logging.getLogger(__name__) @@ -532,7 +544,7 @@ class Template: self._compiled: jinja2.Template | None = None self.hass = hass self.is_static = not is_template_string(template) - self._exc_info: sys._OptExcInfo | None = None + self._exc_info: OptExcInfo | None = None self._limited: bool | None = None self._strict: bool | None = None self._log_fn: Callable[[int, str], None] | None = None diff --git a/requirements_test.txt b/requirements_test.txt index f9763630767..bac3ba2e20c 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -12,7 +12,7 @@ coverage==7.6.8 freezegun==1.5.1 license-expression==30.4.0 mock-open==1.4.0 -mypy-dev==1.14.0a3 +mypy-dev==1.14.0a5 pre-commit==4.0.0 pydantic==1.10.19 pylint==3.3.1