diff mbox series

[libgpiod,v4,20/20] bindings: python: make vals in gpiod_Line_set_value consistent with other functions

Message ID 20191201032407.23589-21-warthog618@gmail.com
State New
Headers show
Series Add support for bias flags and SET_CONFIG | expand

Commit Message

Kent Gibson Dec. 1, 2019, 3:24 a.m. UTC
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 <warthog618@gmail.com>
---
 bindings/python/gpiodmodule.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/bindings/python/gpiodmodule.c b/bindings/python/gpiodmodule.c
index 6086715..5f74513 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);