1
0
mirror of synced 2024-11-12 01:00:46 +01:00

Fix compatibility with python < 3.8 by switching from typing.Final to typing_extensions.Final

This commit is contained in:
seth 2021-06-07 00:46:39 -05:00 committed by Jennifer Taylor
parent 4a18f43253
commit 061ff796f6
11 changed files with 21 additions and 12 deletions

View File

@ -1,4 +1,5 @@
from typing import Dict, Final, List from typing import Dict, List
from typing_extensions import Final
class CardCipherException(Exception): class CardCipherException(Exception):

View File

@ -1,4 +1,4 @@
from typing import Final from typing_extensions import Final
class GameConstants: class GameConstants:

View File

@ -2,7 +2,8 @@ import calendar
import datetime import datetime
from dateutil import tz from dateutil import tz
from typing import List, Final, Optional from typing import List, Optional
from typing_extensions import Final
class Time: class Time:

View File

@ -1,5 +1,6 @@
import os import os
from typing import TYPE_CHECKING, Any, Dict, Final, List, Set, Optional from typing import TYPE_CHECKING, Any, Dict, List, Set, Optional
from typing_extensions import Final
from .expression import Register from .expression import Register

View File

@ -1,5 +1,6 @@
import os import os
from typing import TYPE_CHECKING, Any, Dict, Final, List, Tuple, Optional, Union from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Optional, Union
from typing_extensions import Final
if TYPE_CHECKING: if TYPE_CHECKING:
# Circular import otherwise # Circular import otherwise

View File

@ -1,5 +1,6 @@
import os import os
from typing import Any, Final, List, Sequence, Union from typing import Any, List, Sequence, Union
from typing_extensions import Final
from .expression import ( from .expression import (
Expression, Expression,

View File

@ -1,5 +1,6 @@
import struct import struct
from typing import Optional, Final, List, Dict, Any from typing import Optional, List, Dict, Any
from typing_extensions import Final
from bemani.protocol.stream import InputStream, OutputStream from bemani.protocol.stream import InputStream, OutputStream
from bemani.protocol.node import Node from bemani.protocol.node import Node

View File

@ -1,7 +1,8 @@
import ctypes import ctypes
import os import os
from collections import defaultdict from collections import defaultdict
from typing import Generator, Final, List, MutableMapping, Optional, Set, Tuple from typing import Generator, List, MutableMapping, Optional, Set, Tuple
from typing_extensions import Final
from .. import package_root from .. import package_root

View File

@ -1,7 +1,7 @@
import copy import copy
import struct import struct
from typing import Any, Dict, Final, List, Optional, Union from typing import Any, Dict, List, Optional, Union
from typing_extensions import Final
# Hack to get around mypy's lack of scoping on types. # Hack to get around mypy's lack of scoping on types.
_renamed_float = float _renamed_float = float

View File

@ -1,6 +1,7 @@
import binascii import binascii
import hashlib import hashlib
from typing import Final, Optional from typing import Optional
from typing_extensions import Final
from bemani.protocol.lz77 import Lz77 from bemani.protocol.lz77 import Lz77
from bemani.protocol.binary import BinaryEncoding from bemani.protocol.binary import BinaryEncoding

View File

@ -1,6 +1,7 @@
import copy import copy
import struct import struct
from typing import Any, Dict, Final, Iterator, List, Optional, Tuple from typing import Any, Dict, Iterator, List, Optional, Tuple
from typing_extensions import Final
from bemani.protocol.stream import InputStream from bemani.protocol.stream import InputStream
from bemani.protocol.node import Node from bemani.protocol.node import Node