diff options
-rw-r--r-- | poezio/core/command_defs.py | 10 | ||||
-rw-r--r-- | poezio/logger.py | 2 | ||||
-rw-r--r-- | poezio/types.py | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/poezio/core/command_defs.py b/poezio/core/command_defs.py index e46b83a1..28bb053c 100644 --- a/poezio/core/command_defs.py +++ b/poezio/core/command_defs.py @@ -3,15 +3,7 @@ from typing import Callable, List, Optional from poezio.core.commands import CommandCore from poezio.core.completions import CompletionCore from poezio.plugin_manager import PluginManager - - -try: - from typing_extensions import TypedDict -except ImportError: - from sys import version_info - if version_info < (3, 9): - raise - from typing import TypedDict +from poezio.types import TypedDict CommandDict = TypedDict( diff --git a/poezio/logger.py b/poezio/logger.py index e13db524..0a7947db 100644 --- a/poezio/logger.py +++ b/poezio/logger.py @@ -20,7 +20,7 @@ from poezio.config import config from poezio.xhtml import clean_text from poezio.ui.types import Message, BaseMessage, LoggableTrait from slixmpp import JID -from slixmpp.types import TypedDict, Literal +from poezio.types import TypedDict, Literal import logging diff --git a/poezio/types.py b/poezio/types.py new file mode 100644 index 00000000..66ce802f --- /dev/null +++ b/poezio/types.py @@ -0,0 +1,8 @@ +"""Poezio type stuff""" + +try: + from typing import TypedDict, Literal +except ImportError: + from typing_extensions import TypedDict, Literal + +__all__ = ['TypedDict', 'Literal'] |