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