Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions protobuf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
Source: https://github.com/protocolbuffers/protobuf/archive/v%{realversion}.zip
Requires: zlib
BuildRequires: cmake ninja
# improves text_format printing
Patch0: protobuf_text_format

%prep
%setup -n %{n}-%{realversion}
%patch0 -p1
# Make sure the default c++sdt stand is c++11
grep -q 'CMAKE_CXX_STANDARD *11' CMakeLists.txt
sed -i -e 's|CMAKE_CXX_STANDARD *11|CMAKE_CXX_STANDARD %{cms_cxx_standard}|' CMakeLists.txt
Expand Down
15 changes: 15 additions & 0 deletions protobuf_text_format.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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: