key.c: Make the `KeyFile' key-lookup methods behave consistently.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 25 Nov 2019 12:00:52 +0000 (12:00 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 25 Nov 2019 17:51:33 +0000 (17:51 +0000)
commitf205cc7ab59d556b20f9b00bccd336eaacd6e489
treedecf10bd0ef88fcb28a371a8243c7f6143a1480c
parentdedc5483769a86aace92003a3e10f1881e015e35
key.c: Make the `KeyFile' key-lookup methods behave consistently.

Annoyingly, `byid' and `bytag' would raise `KERR_NOTFOUND', while
`bytype' would give you `None'.  Resolve this: add a `fail' keyword
argument to each method, which defaults to true: if `fail' is true then
a failed lookup raises `KERR_NOTFOUND'; if false, then you get `None'.
key.c
t/t-key.py