Skip to content

Commit cf32d6e

Browse files
jeanseb6windrjarry
authored andcommitted
data: force key_values to str
In a SList, if you have a key not in str type (uint16 for example), the str2c function will not manage to convert it to cdata str because it waits only for str type. So we force str type in order to fix this problem.
1 parent 1f37da4 commit cf32d6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libyang/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ def _create_list(_parent, module, name, key_values, in_rpc_output=False):
10941094
str2c(name),
10951095
in_rpc_output,
10961096
n,
1097-
*[str2c(i) for i in key_values],
1097+
*[str2c(str(i)) for i in key_values],
10981098
)
10991099
if ret != lib.LY_SUCCESS:
11001100
if _parent:

0 commit comments

Comments
 (0)