fixed field types should be int

This commit is contained in:
James Lan
2020-06-11 22:23:45 -07:00
parent eec24e4ee8
commit 04dce524aa
3 changed files with 16 additions and 2 deletions

View File

@@ -103,9 +103,9 @@ def py_type(
message: DescriptorProto,
descriptor: FieldDescriptorProto,
) -> str:
if descriptor.type in [1, 2, 6, 7, 15, 16]:
if descriptor.type in [1, 2]:
return "float"
elif descriptor.type in [3, 4, 5, 13, 17, 18]:
elif descriptor.type in [3, 4, 5, 6, 7, 13, 15, 16, 17, 18]:
return "int"
elif descriptor.type == 8:
return "bool"