- /* Get the input buffer as Python "string" (byte array). */
- /* TODO: int vs. uint64_t for 'inbuflen'? */
-
- py_value = Py_BuildValue("{sisiss#}",
- "time", _timehack,
- "duration", 10,
- "data", inbuf, inbuflen / _unitsize
- );
-
- if (!(py_res = PyObject_CallMethod(py_instance, "decode",
- "O", py_value))) { /* NEWREF */
- ret = SRD_ERR_PYTHON; /* TODO: More specific error? */
- goto err_run_decref_args;
- }
-
+ if (!(py_res = PyObject_CallMethod(py_instance, "decode",
+ "{s:i,s:i,s:s#}",
+ "time", _timehack,
+ "duration", 10,
+ "data", inbuf, inbuflen))) { /* NEWREF */
+ if (PyErr_Occurred())
+ PyErr_Print(); /* Returns void. */