core/cbor: fix string conversion to work with bytearrays

pull/213/head
Pavol Rusnak 5 years ago
parent 31506d81e9
commit 1ee5068128
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -139,7 +139,7 @@ def _cbor_decode(cbor):
return (data[0:ln], data[ln:])
elif fb_type == _CBOR_TEXT_STRING:
ln, data = _read_length(cbor[1:], fb_aux)
return (data[0:ln].decode(), data[ln:])
return (bytes(data[0:ln]).decode(), data[ln:])
elif fb_type == _CBOR_ARRAY:
if fb_aux == _CBOR_VAR_FOLLOWS:
res = []

Loading…
Cancel
Save