Merge pull request #53235 from saltstack/revert-52934-fix_msgpack

Revert "Update msgpack calls for newer msgpack"
This commit is contained in:
Pedro Algarvio 2019-05-24 14:35:19 +01:00 committed by GitHub
commit 14aeeeaab3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -254,15 +254,11 @@ class IPCClient(object):
self.socket_path = socket_path
self._closing = False
self.stream = None
# msgpack deprecated `encoding` starting with version 0.5.2
if msgpack.version >= (0, 5, 2):
msgpack_kwargs = {'raw': False}
if six.PY2:
encoding = None
else:
if six.PY2:
msgpack_kwargs = {'encoding': None}
else:
msgpack_kwargs = {'encoding': 'utf-8'}
self.unpacker = msgpack.Unpacker(**msgpack_kwargs)
encoding = 'utf-8'
self.unpacker = msgpack.Unpacker(encoding=encoding)
def connected(self):
return self.stream is not None and not self.stream.closed()