Skip to content

Commit 5f271bf

Browse files
committed
msgpack: Add 1.0.0 version support
1 parent 8ffb44e commit 5f271bf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tarantool/response.py

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

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

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

0 commit comments

Comments
 (0)