'Dump to a py2-unicode or py3-string'

def _dump_string(self, obj, dumper=None):

    if PY3:
        return yaml.dump(obj, Dumper=dumper)
    else:
        return yaml.dump(obj, Dumper=dumper, encoding=None)
