diff --git a/distributed/protocol/utils.py b/distributed/protocol/utils.py index fd50b6ca094..8dc75a28c63 100644 --- a/distributed/protocol/utils.py +++ b/distributed/protocol/utils.py @@ -120,8 +120,11 @@ def unpack_frames(b): -------- pack_frames """ + b = memoryview(b) + fmt = "Q" fmt_size = struct.calcsize(fmt) + (n_frames,) = struct.unpack_from(fmt, b) lengths = struct.unpack_from(f"{n_frames}{fmt}", b, fmt_size)