Skip to content

Commit 82b5d2b

Browse files
committed
skip contiguous check on py2
1 parent a5fb977 commit 82b5d2b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jupyter_client/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,9 @@ def send(self, stream, msg_or_type, content=None, parent=None, ident=None,
708708
view = memoryview(buf)
709709
except TypeError:
710710
raise TypeError("Buffer objects must support the buffer protocol.")
711-
if not view.contiguous:
711+
# memoryview.contiguous is new in 3.3,
712+
# just skip the check on Python 2
713+
if hasattr(view, 'contiguous') and not view.contiguous:
712714
# zmq requires memoryviews to be contiguous
713715
raise ValueError("Buffer %i (%r) is not contiguous" % (idx, buf))
714716

0 commit comments

Comments
 (0)