fix: typing imports for 3.9
This commit is contained in:
parent
93daf17324
commit
b729de9147
3 changed files with 10 additions and 10 deletions
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
8
poezio/types.py
Normal file
8
poezio/types.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
"""Poezio type stuff"""
|
||||
|
||||
try:
|
||||
from typing import TypedDict, Literal
|
||||
except ImportError:
|
||||
from typing_extensions import TypedDict, Literal
|
||||
|
||||
__all__ = ['TypedDict', 'Literal']
|
Loading…
Reference in a new issue