fix: do not use Literal

This commit is contained in:
mathieui 2021-04-11 14:29:21 +02:00
parent b729de9147
commit 6b2c12c16c
2 changed files with 5 additions and 5 deletions

View file

@ -20,7 +20,7 @@ from poezio.config import config
from poezio.xhtml import clean_text from poezio.xhtml import clean_text
from poezio.ui.types import Message, BaseMessage, LoggableTrait from poezio.ui.types import Message, BaseMessage, LoggableTrait
from slixmpp import JID from slixmpp import JID
from poezio.types import TypedDict, Literal from poezio.types import TypedDict
import logging import logging
@ -68,7 +68,7 @@ class LogMessage(LogItem):
LogDict = TypedDict( LogDict = TypedDict(
'LogDict', 'LogDict',
{ {
'type': Literal['message', 'info'], 'txt': str, 'time': datetime, 'type': str, 'txt': str, 'time': datetime,
'history': bool, 'nickname': str 'history': bool, 'nickname': str
}, },
total=False, total=False,

View file

@ -1,8 +1,8 @@
"""Poezio type stuff""" """Poezio type stuff"""
try: try:
from typing import TypedDict, Literal from typing import TypedDict
except ImportError: except ImportError:
from typing_extensions import TypedDict, Literal from typing_extensions import TypedDict
__all__ = ['TypedDict', 'Literal'] __all__ = ['TypedDict']