mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +00:00
protobuf: fix repeated fields
This commit is contained in:
parent
be069a771b
commit
b2299c118a
@ -22,8 +22,9 @@ def build_protobuf_message(message_type, callback, *args):
|
|||||||
if not _is_scalar_type(field_type):
|
if not _is_scalar_type(field_type):
|
||||||
field_value = yield from build_protobuf_message(field_type, callback)
|
field_value = yield from build_protobuf_message(field_type, callback)
|
||||||
if field_flags & FLAG_REPEATED:
|
if field_flags & FLAG_REPEATED:
|
||||||
field_value = getattr(
|
prev_value = getattr(message, field_name, [])
|
||||||
message, field_name, []).append(field_value)
|
prev_value.append(field_value)
|
||||||
|
field_value = prev_value
|
||||||
setattr(message, field_name, field_value)
|
setattr(message, field_name, field_value)
|
||||||
except EOFError:
|
except EOFError:
|
||||||
callback(message, *args)
|
callback(message, *args)
|
||||||
|
Loading…
Reference in New Issue
Block a user