[Misc] Upgrade more code to Python 3.10 (#26463)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-10-09 10:43:53 +01:00
committed by GitHub
parent e4791438ed
commit dc7976dd9f
7 changed files with 16 additions and 33 deletions
+1 -3
View File
@@ -290,9 +290,7 @@ class MsgpackDecoder:
_log_insecure_serialization_warning()
def decode(self, bufs: Union[bytestr, Sequence[bytestr]]) -> Any:
if isinstance(bufs, (bytes, bytearray, memoryview, zmq.Frame)):
# TODO - This check can become `isinstance(bufs, bytestr)`
# as of Python 3.10.
if isinstance(bufs, bytestr): # type: ignore
return self.decoder.decode(bufs)
self.aux_buffers = bufs