[Bugfix] Fix the remaining Python 3.10 breakages (#7985)

Signed-off-by: Armaan Amatya <armaanamatya2014@gmail.com>
Signed-off-by: Yueqian Lin <70319226+linyueqian@users.noreply.github.com>
Co-authored-by: Yueqian Lin <70319226+linyueqian@users.noreply.github.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
authored and GitHub committed 2026-09-30 11:38:23 +08:00
1 parent 989161c49d
commit aa41a3ac97
8 files changed
+51 -8

No files matched your search

+7 -1
View File
@@ -47,7 +47,7 @@ class DuplexCommandError(RealtimeProtocolError):
"""
@dataclass(frozen=True, slots=True, kw_only=True)
@dataclass(frozen=True, kw_only=True)
class DuplexCommand(RealtimeCommand):
"""A Realtime command as the duplex engine handles it.
@@ -55,6 +55,12 @@ class DuplexCommand(RealtimeCommand):
command; every concrete class below pairs this with its protocol twin.
"""
# No instance fields of its own, so the slots are empty. Spelled out rather
# than ``slots=True`` because on Python 3.10 ``dataclass`` repeats the
# inherited fields in ``__slots__`` (fixed in 3.11); the concrete classes
# below would then combine two slotted layouts and fail to import.
__slots__ = ()
#: Mailbox event type this command renders to (see ``payload()``).
type: ClassVar[str] = ""