Probably need a py2/3 compatibility thing here. I think there is a dict_iteritems defined in the compatibility submodule.