Fix non raw msg pack msg decoding

This commit is contained in:
Daniel A. Wozniak 2019-04-30 01:05:46 +00:00 committed by Pedro Algarvio
parent f193f0f2ec
commit ce782ff27a
No known key found for this signature in database
GPG Key ID: BB36BF6584A298FF

View File

@ -148,6 +148,9 @@ class Serial(object):
# that under Python 2 we can still work with older versions
# of msgpack.
if msgpack.version >= (0, 5, 2):
if encoding is None:
loads_kwargs['raw'] = True
else:
loads_kwargs['raw'] = False
else:
loads_kwargs['encoding'] = encoding