Fix json_format.py in py26

This commit is contained in:
Jisi Liu 2016-03-31 13:36:32 -07:00
parent 94aa50ffd6
commit fc7eeda69c

View file

@ -271,8 +271,10 @@ def _ListValueMessageToJsonObject(message, unused_including_default=False):
def _StructMessageToJsonObject(message, unused_including_default=False):
"""Converts Struct message according to Proto3 JSON Specification."""
fields = message.fields
return {key: _ValueMessageToJsonObject(fields[key])
for key in fields}
ret = {}
for key in fields:
ret[key] = _ValueMessageToJsonObject(fields[key])
return ret
def _IsWrapperMessage(message_descriptor):