Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1398d6 commit 4abb13bCopy full SHA for 4abb13b
1 file changed
IPython/html/base/zmqhandlers.py
@@ -8,6 +8,7 @@
8
import json
9
import struct
10
import warnings
11
+import sys
12
13
try:
14
from urllib.parse import urlparse # Py 3
@@ -43,8 +44,8 @@ def serialize_binary_message(msg):
43
44
# don't modify msg or buffer list in-place
45
msg = msg.copy()
46
buffers = list(msg.pop('buffers'))
- # for python 2, copy the buffer memoryviews to byte strings
47
- buffers = [x.tobytes() for x in buffers]
+ if sys.version_info < (3, 4):
48
+ buffers = [x.tobytes() for x in buffers]
49
bmsg = json.dumps(msg, default=date_default).encode('utf8')
50
buffers.insert(0, bmsg)
51
nbufs = len(buffers)
0 commit comments