Skip to content

Commit e9bab18

Browse files
committed
msgpack: Add 1.0.0 version support
1 parent e60813f commit e9bab18

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: tarantool/response.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,19 @@ def __init__(self, conn, response):
5454
# created in the __new__().
5555
# super(Response, self).__init__()
5656

57+
kwargs = dict(use_list=True)
58+
if msgpack.version >= (1, 0, 0):
59+
# XXX: Explain why it is necessary.
60+
kwargs['strict_map_key'] = False
5761
if msgpack.version >= (0, 5, 2) and conn.encoding == 'utf-8':
5862
# Get rid of the following warning.
5963
# > PendingDeprecationWarning: encoding is deprecated,
6064
# > Use raw=False instead.
61-
unpacker = msgpack.Unpacker(use_list=True, raw=False)
65+
kwargs['raw'] = False
6266
elif conn.encoding is not None:
63-
unpacker = msgpack.Unpacker(use_list=True, encoding=conn.encoding)
64-
else:
65-
unpacker = msgpack.Unpacker(use_list=True)
67+
kwargs['encoding'] = conn.encoding
6668

69+
unpacker = msgpack.Unpacker(**kwargs)
6770
unpacker.feed(response)
6871
header = unpacker.unpack()
6972

0 commit comments

Comments
 (0)