From 0c8d70daae4c4dfc989edad465db94ffc665416d Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 11 Oct 2022 10:26:55 +0200 Subject: [builder][server] restore compatibility with python 3.7 --- src/hydrilla/server/config.py | 6 +++--- src/hydrilla/server/malcontent.py | 2 +- src/hydrilla/server/serve.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/hydrilla/server') diff --git a/src/hydrilla/server/config.py b/src/hydrilla/server/config.py index 51eb875..c0b1c5c 100644 --- a/src/hydrilla/server/config.py +++ b/src/hydrilla/server/config.py @@ -77,9 +77,9 @@ config_schema = { here = Path(__file__).resolve().parent -def load(config_paths: list[Path]=[here / 'config.json'], - can_fail: list[bool]=[]) -> dict: - config: dict[str, t.Any] = {} +def load(config_paths: t.List[Path]=[here / 'config.json'], + can_fail: t.List[bool]=[]) -> t.Dict[str, t.Any]: + config: t.Dict[str, t.Any] = {} bools_missing = max(0, len(config_paths) - len(can_fail)) config_paths = [*config_paths] diff --git a/src/hydrilla/server/malcontent.py b/src/hydrilla/server/malcontent.py index 02acc81..8e4eaa7 100644 --- a/src/hydrilla/server/malcontent.py +++ b/src/hydrilla/server/malcontent.py @@ -236,7 +236,7 @@ class Malcontent: If multiple versions of a mapping are applicable, only the most recent is included in the result. """ - collected: dict[str, item_infos.MappingInfo] = {} + collected: t.Dict[str, item_infos.MappingInfo] = {} for result_set in self.mapping_tree.search(url): for wrapped_mapping_info in result_set: info = wrapped_mapping_info.item diff --git a/src/hydrilla/server/serve.py b/src/hydrilla/server/serve.py index 4e2eb00..7c9789a 100644 --- a/src/hydrilla/server/serve.py +++ b/src/hydrilla/server/serve.py @@ -155,8 +155,8 @@ def get_newest_mapping(identifier_dot_json: str) -> werkzeug.Response: def get_newest_resource(identifier_dot_json: str) -> werkzeug.Response: return get_resource_or_mapping('resource', identifier_dot_json) -def make_ref(info: item_infos.AnyInfo) -> dict[str, t.Any]: - ref: dict[str, t.Any] = { +def make_ref(info: item_infos.AnyInfo) -> t.Dict[str, t.Any]: + ref: t.Dict[str, t.Any] = { 'version': info.version, 'identifier': info.identifier, 'long_name': info.long_name -- cgit v1.2.3