IO.pyx not compatible with Py3, breaks Rivet validation machinery

Currently, the Rivet validation machinery breaks on machines running Python3 because (I think):

206 def writeYODA(ana_objs, file_or_filename):
207     """
208     Write data objects to the provided file in YODA format.
209     """
210     cdef c.ostringstream oss
211     cdef vector[c.AnalysisObject*] vec
212     cdef AnalysisObject a
213     aolist = ana_objs.values() if hasattr(ana_objs, "values") else ana_objs \
214              if hasattr(ana_objs, "__iter__") else [ana_objs]
215     for a in aolist:
216         vec.push_back(a._AnalysisObject())
217     if type(file_or_filename) is str:
218         c.WriterYODA_create().write_to_file(file_or_filename, vec)
219     else:
220         c.WriterYODA_create().write(oss, vec)
221         _str_to_file(oss.str(), file_or_filename)

the str means something different in Py2 vs Py3. 😕