From: Kent Gibson Date: Sun, 1 Dec 2019 03:24:07 +0000 (+0800) Subject: bindings: python: make vals in gpiod_Line_set_value consistent with other functions X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3e30364cc1a641dcef7f385842f683be8ba74c6f;p=qemu-gpiodev%2Flibgpiod.git bindings: python: make vals in gpiod_Line_set_value consistent with other functions Change the vals in gpiod_Line_set_value from a tuple of tuples to just a tuple. This brings it into line with other vals in the module such as gpiod_Line_set_config and gpiod_Line_set_direction_output. The previous usage made the vals equivalent to an args (a tuple of arguments equivalent to argc,argv in C), as per gpiod_Line_set_flags. Renaming vals to args in gpiod_Line_set_value was not an option as there is already an args parameter. Signed-off-by: Kent Gibson Signed-off-by: Bartosz Golaszewski --- diff --git a/bindings/python/gpiodmodule.c b/bindings/python/gpiodmodule.c index bb2f4aa..00f624b 100644 --- a/bindings/python/gpiodmodule.c +++ b/bindings/python/gpiodmodule.c @@ -585,14 +585,14 @@ static PyObject *gpiod_Line_set_value(gpiod_LineObject *self, PyObject *args) if (!bulk_obj) return NULL; - vals = Py_BuildValue("((O))", val); + vals = Py_BuildValue("(O)", val); if (!vals) { Py_DECREF(bulk_obj); return NULL; } ret = PyObject_CallMethod((PyObject *)bulk_obj, - "set_values", "O", vals); + "set_values", "(O)", vals); Py_DECREF(bulk_obj); Py_DECREF(vals);