Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion third_party/protobuf/protobuf.patch
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,32 @@ index 162531226..e93ec4809 100644
+ return result;
}

// If the calling code is not a _pb2.py file, raise AttributeError.
// If the calling code is not a _pb2.py file, raise AttributeError.
diff --git a/python/google/protobuf/text_format.py b/python/google/protobuf/text_format.py
index a6d8bcf64..24da4cac5 100644
--- a/python/google/protobuf/text_format.py
+++ b/python/google/protobuf/text_format.py
@@ -470,9 +470,7 @@ class _Printer(object):
entry_submsg = value.GetEntryClass()(key=key, value=value[key])
self.PrintField(field, entry_submsg)
elif field.label == descriptor.FieldDescriptor.LABEL_REPEATED:
- if (self.use_short_repeated_primitives
- and field.cpp_type != descriptor.FieldDescriptor.CPPTYPE_MESSAGE
- and field.cpp_type != descriptor.FieldDescriptor.CPPTYPE_STRING):
+ if self.use_short_repeated_primitives:
self._PrintShortRepeatedPrimitivesValue(field, value)
else:
for element in value:
diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h
index 287d58f..c243e4a 100644
--- a/src/google/protobuf/map_field.h
+++ b/src/google/protobuf/map_field.h
@@ -348,7 +348,7 @@ class PROTOBUF_EXPORT MapFieldBase {
: arena_(arena), repeated_field_(nullptr), state_(STATE_MODIFIED_MAP) {}

protected:
- ~MapFieldBase() { // "protected" stops users from deleting a `MapFieldBase *`
+ virtual ~MapFieldBase() { // "protected" stops users from deleting a `MapFieldBase *`
GOOGLE_DCHECK(repeated_field_ == nullptr);
}
void Destruct();