- if (!(py_str = PyObject_GetAttrString((PyObject *)py_obj, attr))) {
- srd_exception_catch("");
- return SRD_ERR_PYTHON;
- }
-
- if (!PyUnicode_Check(py_str)) {
- srd_dbg("%s attribute should be a string, but is a %s.",
- attr, Py_TYPE(py_str)->tp_name);
- Py_DecRef(py_str);
+ if (!(py_str = PyObject_GetAttrString(py_obj, attr))) {
+ srd_exception_catch("Failed to get attribute '%s'", attr);