Commit 6e54808
fix TypeError: function takes exactly 3 arguments (2 given) from wait_for_edge
Trying to parse 3 required arguments and then falling back to 2 will set the
PyError condition when only two arguments are present even though the
wait_for_edge function as a whole succeeds. According to
https://docs.python.org/2/c-api/exceptions.html, returning normally after this
will lead to undefined behavior the next time the code enters the C API.
Fix this by using the PyArg_ParseTuple optional argument feature instead of
trying to parse 3 arguments and falling back to 2 if it fails.1 parent a9353da commit 6e54808
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
451 | 450 | | |
452 | 451 | | |
453 | 452 | | |
| |||
0 commit comments