[Misc] Upgrade more code to Python 3.10 (#26463)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user