host: Python 2 compatibility for umtrx_property_tree.py

bytes(u'something', 'utf-8') is only available in Python 3. A backwards
compatible version of it is u'something'.encode('utf-8').
This commit is contained in:
Alexander Chemeris
2017-08-14 23:45:12 +03:00
parent 1e0c879f53
commit 1421327cfe

View File

@@ -26,7 +26,7 @@ class umtrx_property_tree:
d = dict(action=action, path=path)
if value_type is not None: d['type'] = value_type
if value is not None: d['value'] = value
return self.s.send(bytes(json.dumps(d)+'\n', 'UTF-8'))
return self.s.send((json.dumps(d)+'\n').encode('UTF-8'))
def _recv_response(self):
resp = self.f.readline().strip()