Skip to content

Commit

Permalink
use memoryview instead of buffer on 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Oct 29, 2010
1 parent 2ca6e5a commit 3bb1b19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zmq/tests/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def test_memoryview(self):
v = memoryview(s)
m = zmq.Message(s)
buf = m.buffer
s2 = bytes(buf)
s2 = buf.tobytes()
self.assertEquals(s2,s)
self.assertEquals(m.bytes,s)

Expand Down
2 changes: 1 addition & 1 deletion zmq/utils/buffers.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ cdef inline object viewfromobject(object obj, int readonly):
-------
Buffer/View of the original object.
"""
if oldstyle_available():
if not memoryview_available():
if readonly:
return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
else:
Expand Down

0 comments on commit 3bb1b19

Please sign in to comment.