Fix problem with uninitialized unions in _from_dict
This commit is contained in:
@@ -741,7 +741,12 @@ cdef _to_dict(msg, bint verbose):
|
||||
cdef _from_dict(_DynamicStructBuilder msg, dict d):
|
||||
for key, val in d.iteritems():
|
||||
if key != 'which':
|
||||
msg._set(key, val)
|
||||
try:
|
||||
msg._set(key, val)
|
||||
except Exception as e:
|
||||
if 'expected isSetInUnion(field)' in str(e):
|
||||
msg.init(key)
|
||||
msg._set(key, val)
|
||||
|
||||
cdef _from_list(_DynamicListBuilder msg, list d):
|
||||
cdef size_t count = 0
|
||||
|
||||
Reference in New Issue
Block a user