Fix msgpack for new version

This commit is contained in:
Matthew Honnibal 2018-07-20 17:32:00 +02:00
parent 899f1cf442
commit e0caf3ae8c
2 changed files with 3 additions and 3 deletions

View File

@ -828,8 +828,8 @@ cdef class Doc:
# users don't mind getting a list instead of a tuple. # users don't mind getting a list instead of a tuple.
if 'user_data' not in exclude and 'user_data_keys' in msg: if 'user_data' not in exclude and 'user_data_keys' in msg:
user_data_keys = msgpack.loads(msg['user_data_keys'], user_data_keys = msgpack.loads(msg['user_data_keys'],
use_list=False) use_list=False, raw=False)
user_data_values = msgpack.loads(msg['user_data_values']) user_data_values = msgpack.loads(msg['user_data_values'], raw=False)
for key, value in zip(user_data_keys, user_data_values): for key, value in zip(user_data_keys, user_data_values):
self.user_data[key] = value self.user_data[key] = value

View File

@ -487,7 +487,7 @@ def to_bytes(getters, exclude):
def from_bytes(bytes_data, setters, exclude): def from_bytes(bytes_data, setters, exclude):
msg = msgpack.loads(bytes_data, encoding='utf8') msg = msgpack.loads(bytes_data, raw=False)
for key, setter in setters.items(): for key, setter in setters.items():
if key not in exclude and key in msg: if key not in exclude and key in msg:
setter(msg[key]) setter(msg[key])