Simplify config entry cache clear (#114691)

same as #113136 but for config entries
pull/114741/head
J. Nick Koston 2024-04-03 00:21:37 -10:00 committed by GitHub
parent cf4c02b9fa
commit ef047707d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -13,7 +13,6 @@ from collections.abc import (
Mapping, Mapping,
ValuesView, ValuesView,
) )
import contextlib
from contextvars import ContextVar from contextvars import ContextVar
from copy import deepcopy from copy import deepcopy
from enum import Enum, StrEnum from enum import Enum, StrEnum
@ -463,8 +462,7 @@ class ConfigEntry:
def clear_cache(self) -> None: def clear_cache(self) -> None:
"""Clear cached properties.""" """Clear cached properties."""
with contextlib.suppress(AttributeError): self.__dict__.pop("as_json_fragment", None)
delattr(self, "as_json_fragment")
@cached_property @cached_property
def as_json_fragment(self) -> json_fragment: def as_json_fragment(self) -> json_fragment: