Use keys() instead of iterkeys() to be python3 compatbile.

This commit is contained in:
Jie Luo 2017-07-24 15:44:16 -07:00 committed by GitHub
parent 72cc5a6eb3
commit a484794820

View File

@ -819,7 +819,7 @@ def MapEncoder(field_descriptor):
encode_message = MessageEncoder(field_descriptor.number, False, False)
def EncodeField(write, value, deterministic):
value_keys = sorted(value.iterkeys()) if deterministic else value.iterkeys()
value_keys = sorted(value.keys()) if deterministic else value.keys()
for key in value_keys:
entry_msg = message_type._concrete_class(key=key, value=value[key])
encode_message(write, entry_msg, deterministic)