提交 a45068bb 编写于 作者: C changsh726 提交者: Liu Jiaming

Cyber: fix decoding error when using cyber_channel info

上级 d53668c8
......@@ -691,8 +691,7 @@ static PyObject *cyber_PyChannelUtils_get_channels_info(PyObject *self,
size_t pos = 0;
for (auto &attr : roleAttr_list) {
PyList_SetItem(pyobj_list, pos,
Py_BuildValue("s#", attr.c_str(), attr.size()));
PyList_SetItem(pyobj_list, pos, C_STR_TO_PY_BYTES(attr));
pos++;
}
PyDict_SetItem(pyobj_channelinfo_dict, bld_name, pyobj_list);
......
......@@ -8,6 +8,7 @@ py_binary(
name = "cyber_channel",
srcs = ["cyber_channel.py"],
deps = [
"//cyber/proto:role_attributes_py_pb2",
"//cyber/python/cyber_py3:cyber",
"//cyber/python/cyber_py3:cyber_time",
],
......
......@@ -248,6 +248,7 @@ def _channel_cmd_hz(argv):
def print_role(rolsattr_rawdata):
from google.protobuf.message import DecodeError
from cyber.proto.role_attributes_pb2 import RoleAttributes
try:
msg = RoleAttributes()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册