2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-28 11:57:37 +00:00

Fix python3 idxtoname

python3 needs it to be str, not
bytes as C would return.
Accomodate only for python3, leave
python2 the same.
This commit is contained in:
Jarrod Johnson 2020-05-29 12:06:00 -04:00
parent 2a9d4e8079
commit 6ee9ccbc27

View File

@ -113,7 +113,10 @@ _idxtoname.argtypes = [ctypes.c_uint, ctypes.c_char_p]
def idxtoname(idx):
name = (ctypes.c_char * 16)()
_idxtoname(idx, name)
return name.value.strip()
ret = name.value.strip()
if not isinstance(ret, str):
ret = ret.deecode('utf8')
return ret
_idxtobcast = {}
def get_bcastaddr(idx):