if (PyString_Check(data)) {
rval = self->SetData(format, PyString_Size(data), PyString_AsString(data));
}
else {
// raise a TypeError if not a string
PyErr_SetString(PyExc_TypeError, "String expected.");
if (PyString_Check(data)) {
rval = self->SetData(format, PyString_Size(data), PyString_AsString(data));
}
else {
// raise a TypeError if not a string
PyErr_SetString(PyExc_TypeError, "String expected.");