diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2015-02-25 16:39:11 -0800 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2015-02-25 16:39:11 -0800 |
commit | ada65567852b96fdb4d070c0c3f86ca7b77824f9 (patch) | |
tree | a506994ce921ace3e6f88ca130a17af7f85c3d0f /python/google/protobuf/text_format.py | |
parent | 581be24606a925d038f382dc4c86256e2d29e001 (diff) |
Down integrate from Google internal.
Change-Id: I34d301133eea9c6f3a822c47d1f91e136fd33145
Diffstat (limited to 'python/google/protobuf/text_format.py')
-rwxr-xr-x | python/google/protobuf/text_format.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/python/google/protobuf/text_format.py b/python/google/protobuf/text_format.py index fb54c50c..a47ce3e3 100755 --- a/python/google/protobuf/text_format.py +++ b/python/google/protobuf/text_format.py @@ -319,6 +319,11 @@ def _MergeField(tokenizer, message, allow_multiple_scalars): ParseError: In case of ASCII parsing problems. """ message_descriptor = message.DESCRIPTOR + if (hasattr(message_descriptor, 'syntax') and + message_descriptor.syntax == 'proto3'): + # Proto3 doesn't represent presence so we can't test if multiple + # scalars have occurred. We have to allow them. + allow_multiple_scalars = True if tokenizer.TryConsume('['): name = [tokenizer.ConsumeIdentifier()] while tokenizer.TryConsume('.'): |