diff --git a/src/python/jw/pkg/App.py b/src/python/jw/pkg/App.py index 9dfbd118..ccba3931 100644 --- a/src/python/jw/pkg/App.py +++ b/src/python/jw/pkg/App.py @@ -10,7 +10,7 @@ import re import sys from enum import Enum, auto -from functools import lru_cache +from functools import cache from typing import TYPE_CHECKING from .lib.App import App as Base @@ -512,7 +512,7 @@ class App(Base): def strip_module_from_spec(self, mod): return re.sub(r'-dev$|-devel$|-run$', '', re.split('([=><]+)', mod)[0].strip()) - @lru_cache(maxsize = None) + @cache def get_section(self, path: str, section: str) -> str: ret = '' pat = '[' + section + ']' @@ -529,7 +529,7 @@ class App(Base): file.close() return ret.rstrip() - @lru_cache(maxsize = None) + @cache def read_value(self, path: str, section: str, key: str) -> str | None: def scan_section(f, key: str) -> str | None: @@ -582,7 +582,7 @@ class App(Base): return 'none' return None - @lru_cache(maxsize = None) + @cache def get_value(self, project: str, section: str, key: str) -> str | None: ret: str | None proj_dir = self.__proj_dir(project, pretty = False) @@ -612,7 +612,7 @@ class App(Base): ) return ret - @lru_cache(maxsize = None) + @cache def get_version(self, project) -> str: ret = self.get_value(project, 'version', '') if ret is None: