From 9b8d9b29e7b8eb948e62ab63bede438e037c6bb1 Mon Sep 17 00:00:00 2001 From: Christian Geier Date: Mon, 30 Oct 2023 00:12:32 +0100 Subject: [PATCH] import type hints from typing, not collections doesn't seem to work with python 3.8 otherwise --- khal/plugins.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/khal/plugins.py b/khal/plugins.py index fa8c9bf6f3..3e15cba709 100644 --- a/khal/plugins.py +++ b/khal/plugins.py @@ -1,5 +1,4 @@ -from collections.abc import Callable, Mapping -from typing import Dict, List, Tuple +from typing import Callable, Dict, List, Mapping, Tuple from khal._compat import importlib_metadata @@ -9,7 +8,7 @@ # https://setuptools.pypa.io/en/latest/userguide/entry_point.html -def _load_formatters() -> dict[str, Callable[[str, str], str]]: +def _load_formatters() -> Dict[str, Callable[[str, str], str]]: formatter_entrypoints = importlib_metadata.entry_points(group="khal.formatter") return {ep.name: ep.load() for ep in formatter_entrypoints} @@ -22,8 +21,9 @@ def _load_color_themes() -> Dict[str, List[Tuple[str, ...]]]: THEMES: Dict[str, List[Tuple[str, ...]],] = _load_color_themes() -def _load_commands() -> dict[str, Callable]: + +def _load_commands() -> Dict[str, Callable]: command_entrypoints = importlib_metadata.entry_points(group="khal.commands") return {ep.name: ep.load() for ep in command_entrypoints} -COMMANDS: dict[str, Callable] = _load_commands() +COMMANDS: Dict[str, Callable] = _load_commands()