summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-04-11 14:05:56 +0200
committermathieui <mathieui@mathieui.net>2021-04-11 16:33:53 +0200
commitb729de91470d09d7bcd4956357b8192bda7a4981 (patch)
tree015d48445ae797b7cff6b7e04f56beff75f99ff2
parent93daf173244e44744f1e48982f5936beb296ae0b (diff)
downloadpoezio-b729de91470d09d7bcd4956357b8192bda7a4981.tar.gz
poezio-b729de91470d09d7bcd4956357b8192bda7a4981.tar.bz2
poezio-b729de91470d09d7bcd4956357b8192bda7a4981.tar.xz
poezio-b729de91470d09d7bcd4956357b8192bda7a4981.zip
fix: typing imports for 3.9
-rw-r--r--poezio/core/command_defs.py10
-rw-r--r--poezio/logger.py2
-rw-r--r--poezio/types.py8
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']