8000 Remove code and tests for unsupported Python 2.6 (#250) · msgpack/msgpack-python@0fc4ee9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0fc4ee9

Browse files
hugovkmethane
authored andcommitted
Remove code and tests for unsupported Python 2.6 (#250)
1 parent a70ce0c commit 0fc4ee9

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ msgpack/*.cpp
1212
/venv
1313
/tags
1414
/docs/_build
15+
.cache

test/test_pack.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from msgpack import packb, unpackb, Unpacker, Packer
99

10+
from collections import OrderedDict
1011
from io import BytesIO
1112

1213
def check(data, use_list=False):
@@ -136,24 +137,9 @@ def testMapSize(sizes=[0, 5, 50, 1000]):
136137
assert unpacker.unpack() == dict((i, i * 2) for i in range(size))
137138

138139

139-
class odict(dict):
140-
"""Reimplement OrderedDict to run test on Python 2.6"""
141-
def __init__(self, seq):
142-
self._seq = seq
143-
dict.__init__(self, seq)
144-
145-
def items(self):
146-
return self._seq[:]
147-
148-
def iteritems(self):
149-
return iter(self._seq)
150-
151-
def keys(self):
152-
return [x[0] for x in self._seq]
153-
154140
def test_odict():
155141
seq = [(b'one', 1), (b'two', 2), (b'three', 3), (b'four', 4)]
156-
od = odict(seq)
142+
od = OrderedDict(seq)
157143
assert unpackb(packb(od), use_list=1) == dict(seq)
158144
def pair_hook(seq):
159145
return list(seq)

0 commit comments

Comments
 (0)
0