o->def = g_variant_new_double(dval);
} else {
srd_err("Protocol decoder %s option 'default' has "
- "value of unsupported type '%s'.", d->name,
- Py_TYPE(py_default)->tp_name);
+ "value of unsupported type.", d->name);
return SRD_ERR_PYTHON;
}
g_variant_ref_sink(o->def);
/* Import the Python module. */
if (!(d->py_mod = PyImport_ImportModule(module_name))) {
- srd_exception_catch("Import of '%s' failed.", module_name);
+ srd_exception_catch("Import of '%s' failed", module_name);
goto err_out;
}
goto err_out;
}
py_method = PyObject_GetAttrString(d->py_dec, "start");
- if (!PyFunction_Check(py_method)) {
+ if (!PyCallable_Check(py_method)) {
srd_err("Protocol decoder %s Decoder class attribute 'start' "
"is not a method.", module_name);
goto err_out;
goto err_out;
}
py_method = PyObject_GetAttrString(d->py_dec, "decode");
- if (!PyFunction_Check(py_method)) {
+ if (!PyCallable_Check(py_method)) {
srd_err("Protocol decoder %s Decoder class attribute 'decode' "
"is not a method.", module_name);
goto err_out;
return NULL;
if (!(py_str = PyObject_GetAttrString(dec->py_mod, "__doc__"))) {
- srd_exception_catch("");
+ srd_exception_catch("Failed to get docstring");
return NULL;
}