diff options
Diffstat (limited to 'python/google/protobuf/json_format.py')
-rw-r--r-- | python/google/protobuf/json_format.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/python/google/protobuf/json_format.py b/python/google/protobuf/json_format.py index 23382bdb..4342755a 100644 --- a/python/google/protobuf/json_format.py +++ b/python/google/protobuf/json_format.py @@ -271,10 +271,8 @@ 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 - js = {} - for key in fields.keys(): - js[key] = _ValueMessageToJsonObject(fields[key]) - return js + return {key: _ValueMessageToJsonObject(fields[key]) + for key in fields} def _IsWrapperMessage(message_descriptor): |