Drop ChainMap in translation cache (#85260)

This commit is contained in:
J. Nick Koston 2023-01-06 11:52:18 -10:00 committed by GitHub
parent d75087ede5
commit 194adcde9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,6 @@
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio
from collections import ChainMap
from collections.abc import Iterable, Mapping from collections.abc import Iterable, Mapping
import logging import logging
from typing import Any from typing import Any
@ -311,4 +310,7 @@ async def async_get_translations(
cache = hass.data[TRANSLATION_FLATTEN_CACHE] = _TranslationCache(hass) cache = hass.data[TRANSLATION_FLATTEN_CACHE] = _TranslationCache(hass)
cached = await cache.async_fetch(language, category, components) cached = await cache.async_fetch(language, category, components)
return dict(ChainMap(*cached)) result = {}
for entry in cached:
result.update(entry)
return result