Use six.iteritems() instead of dict.items()