Generate/test refactoring

This commit is contained in:
Daniel G. Taylor
2019-10-09 17:21:29 -07:00
parent 1f46e10ba7
commit 1a488faf7a
4 changed files with 49 additions and 11 deletions

View File

@@ -303,7 +303,11 @@ def _postprocess_single(
if meta.proto_type in ["string"]:
value = value.decode("utf-8")
elif meta.proto_type in ["message"]:
value = field.default_factory().parse(value)
orig = value
value = field.default_factory()
if isinstance(value, Message):
# If it's a message (instead of e.g. list) then keep going!
value.parse(orig)
return value