Skip to content

Commit

Permalink
Ensure we return a bytearray in singleton case
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Jun 22, 2020
1 parent d7f58cb commit b73dcd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions distributed/protocol/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import struct
import msgpack

from ..utils import nbytes
from ..utils import ensure_bytearray, nbytes

BIG_BYTES_SHARD_SIZE = 2 ** 26

Expand Down Expand Up @@ -82,7 +82,7 @@ def merge_frames(header, frames):
frames.append(mv[l:])
l = 0
if len(L) == 1: # no work necessary
out.append(L[0])
out.append(ensure_bytearray(L[0]))
else:
out.append(bytearray(b"").join(map(memoryview, L)))
return out
Expand Down

0 comments on commit b73dcd6

Please sign in to comment.