Skip to content

Commit db483eb

Browse files
author
Aidan Jensen
committed
Fix message constructor enum typing
Accept int as an option as well as string and enum Signed-off-by: Aidan Jensen <aidan.jensen@robust.ai>
1 parent 12d5002 commit db483eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/google/protobuf/compiler/python/pyi_generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ void PyiGenerator::PrintMessage(const Descriptor& message_descriptor,
562562
GetFieldType(*field_des, message_descriptor));
563563
} else {
564564
if (field_des->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) {
565-
printer_->Print("_Union[$type_name$, str]", "type_name",
565+
printer_->Print("_Union[$type_name$, str, int]", "type_name",
566566
ModuleLevelName(*field_des->enum_type()));
567567
} else {
568568
printer_->Print(

0 commit comments

Comments
 (0)