Show More
@@ -43,6 +43,8 b' def serialize_binary_message(msg):' | |||
|
43 | 43 | # don't modify msg or buffer list in-place |
|
44 | 44 | msg = msg.copy() |
|
45 | 45 | buffers = list(msg.pop('buffers')) |
|
46 | # for python 2, copy the buffer memoryviews to byte strings | |
|
47 | buffers = [x.tobytes() for x in buffers] | |
|
46 | 48 | bmsg = json.dumps(msg, default=date_default).encode('utf8') |
|
47 | 49 | buffers.insert(0, bmsg) |
|
48 | 50 | nbufs = len(buffers) |
General Comments 0
You need to be logged in to leave comments.
Login now