core.time: hotfix for default force_abbreviations attribute

This commit is contained in:
Dima Gerasimov 2024-09-23 22:01:57 +01:00 committed by karlicoss
parent 6a6d157040
commit a8f86e32b9

View file

@ -11,11 +11,11 @@ def user_forced() -> Sequence[str]:
# https://stackoverflow.com/questions/36067621/python-all-possible-timezone-abbreviations-for-given-timezone-name-and-vise-ve # https://stackoverflow.com/questions/36067621/python-all-possible-timezone-abbreviations-for-given-timezone-name-and-vise-ve
try: try:
from my.config import time as user_config from my.config import time as user_config
return user_config.tz.force_abbreviations # type: ignore[attr-defined] # noqa: TRY300
# note: noqa since we're catching case where config doesn't have attribute here as well
except: except:
# todo log/apply policy # todo log/apply policy
return [] return []
else:
return user_config.tz.force_abbreviations # type: ignore[attr-defined]
@lru_cache(1) @lru_cache(1)