goto err;
}
+ PyGILState_Release(gstate);
+
return py_str_as_str(py_value, outstr);
err:
*
* @private
*/
-SRD_PRIV int py_pydictitem_as_long(PyObject *py_obj, PyObject *py_key, uint64_t *out)
+SRD_PRIV int py_pydictitem_as_long(PyObject *py_obj, PyObject *py_key, int64_t *out)
{
PyObject *py_value;
PyGILState_STATE gstate;
goto err;
}
- *out = PyLong_AsUnsignedLongLong(py_value);
+ *out = PyLong_AsLongLong(py_value);
PyGILState_Release(gstate);
/**
* Convert a Python list of unicode strings to a C string vector.
- * On success, a pointer to a newly allocated NULL-terminated array of
+ * On success, a pointer to a newly allocated NUL-terminated array of
* allocated C strings is written to @a out_strv. The caller must g_free()
* each string and the array itself.
*
}
*out_strv = strv;
+ PyGILState_Release(gstate);
+
return SRD_OK;
err_out:
}
if (!var)
srd_exception_catch("Failed to extract string value");
-
} else if (PyLong_Check(py_obj)) { /* integer */
int64_t val;
var = g_variant_new_int64(val);
else
srd_exception_catch("Failed to extract integer value");
-
} else if (PyFloat_Check(py_obj)) { /* float */
double val;
var = g_variant_new_double(val);
else
srd_exception_catch("Failed to extract float value");
-
} else {
srd_err("Failed to extract value of unsupported type.");
}