summaryrefslogtreecommitdiff
path: root/test/test_buffer.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_buffer.py')
-rw-r--r--test/test_buffer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/test_buffer.py b/test/test_buffer.py
index 87f359f..d723e8d 100644
--- a/test/test_buffer.py
+++ b/test/test_buffer.py
@@ -7,7 +7,10 @@ from msgpack import packb, unpackb
def test_unpack_buffer():
from array import array
buf = array('b')
- buf.fromstring(packb((b'foo', b'bar')))
+ try:
+ buf.frombytes(packb((b'foo', b'bar')))
+ except AttributeError: # PY2
+ buf.fromstring(packb((b'foo', b'bar')))
obj = unpackb(buf, use_list=1)
assert [b'foo', b'bar'] == obj