Merge "Use items() instead of iteritems()"

This commit is contained in:
Zuul 2018-09-01 01:46:57 +00:00 committed by Gerrit Code Review
commit a5bb2c0e5d

View File

@ -94,8 +94,8 @@ class SmarterEncoder(jsonutils.json.JSONEncoder):
"""Help for JSON encoding dict-like objects."""
def default(self, obj):
if not isinstance(obj, dict) and hasattr(obj, 'iteritems'):
return dict(obj.iteritems())
if not isinstance(obj, dict) and hasattr(obj, 'items'):
return dict(obj.items())
return super(SmarterEncoder, self).default(obj)