8000 six.BytesIO => io.BytesIO · imclab/msgpack-python@dee2d87 · GitHub
[go: up one dir, main page]

Skip to content

Commit dee2d87

Browse files
committed
six.BytesIO => io.BytesIO
1 parent 96d7d0e commit dee2d87

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

test/test_pack.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def testPackFloat():
8989
assert packb(1.0, use_single_float=False) == b'\xcb' + struct.pack('>d', 1.0)
9090

9191
def testArraySize(sizes=[0, 5, 50, 1000]):
92-
bio = six.BytesIO()
92+
bio = BytesIO()
9393
packer = Packer()
9494
for size in sizes:
9595
bio.write(packer.pack_array_header(size))
@@ -108,7 +108,7 @@ def test_manualreset(sizes=[0, 5, 50, 1000]):
108108
for i in range(size):
109109
packer.pack(i)
110110

111-
bio = six.BytesIO(packer.bytes())
111+
bio = BytesIO(packer.bytes())
112112
unpacker = Unpacker(bio, use_list=1)
113113
for size in sizes:
114114
assert unpacker.unpack() == list(range(size))
@@ -117,7 +117,7 @@ def test_manualreset(sizes=[0, 5, 50, 1000]):
117117
assert packer.bytes() == b''
118118

119119
def testMapSize(sizes=[0, 5, 50, 1000]):
120-
bio = six.BytesIO()
120+
bio = BytesIO()
121121
packer = Packer()
122122
for size in sizes:
123123
bio.write(packer.pack_map_header(size))

test/test_sequnpack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# coding: utf-8
33

4-
import six
4+
import io
55
from msgpack import Unpacker, BufferFull
66
from msgpack.exceptions import OutOfData
77
from pytest import raises
@@ -79,7 +79,7 @@ def test_readbytes():
7979
assert unpacker.unpack() == ord(b'r')
8080

8181
# Test buffer refill
82-
unpacker = Unpacker(six.BytesIO(b'foobar'), read_size=3)
82+
unpacker = Unpacker(io.BytesIO(b'foobar'), read_size=3)
8383
assert unpacker.unpack() == ord(b'f')
8484
assert unpacker.read_bytes(3) == b'oob'
8585
assert unpacker.unpack() == ord(b'a')

test/test_unpack_raw.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
"""Tests for cases where the user seeks to obtain packed msgpack objects"""
22

3-
import six
3+
import io
44
from msgpack import Unpacker, packb
55

66

77
def test_write_bytes():
88
unpacker = Unpacker()
99
unpacker.feed(b'abc')
10-
f = six.BytesIO()
10+
f = io.BytesIO()
1111
assert unpacker.unpack(f.write) == ord('a')
1212
assert f.getvalue() == b'a'
13-
f = six.BytesIO()
13+
f = io.BytesIO()
1414
assert unpacker.skip(f.write) is None
1515
assert f.getvalue() == b'b'
16-
f = six.BytesIO()
16+
f = io.BytesIO()
1717
assert unpacker.skip() is None
1818
assert f.getvalue() == b''
1919

2020

2121
def test_write_bytes_multi_buffer():
2222
long_val = (5) * 100
2323
expected = packb(long_val)
24-
unpacker = Unpacker(six.BytesIO(expected), read_size=3, max_buffer_size=3)
24+
unpacker = Unpacker(io.BytesIO(expected), read_size=3, max_buffer_size=3)
2525

26-
f = six.BytesIO()
26+
f = io.BytesIO()
2727
unpacked = unpacker.unpack(f.write)
2828
assert unpacked == long_val
2929
assert f.getvalue() == expected

0 commit comments

Comments
 (0)
0