Skip to content

Commit c087b3c

Browse files
authored
Merge pull request #143 from djsutton/fix-wait_for_edge-TypeError
fix TypeError: function takes exactly 3 arguments (2 given) from wait_for_edge
2 parents 8912166 + 6e54808 commit c087b3c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source/py_gpio.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,9 @@ static PyObject *py_wait_for_edge(__attribute__ ((unused)) PyObject *self, PyObj
445445
char error[30];
446446
BBIO_err err;
447447

448-
if (!PyArg_ParseTuple(args, "sii", &channel, &edge, &timeout)){
449-
timeout = -1;
450-
if (!PyArg_ParseTuple(args, "si", &channel, &edge))
451-
return NULL;
448+
timeout = -1;
449+
if (!PyArg_ParseTuple(args, "si|i", &channel, &edge, &timeout)){
450+
return NULL;
452451
}
453452

454453
err = get_gpio_number(channel, &gpio);

0 commit comments

Comments
 (0)