chiark / gitweb /
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>
Sat, 11 Apr 2020 11:49:31 +0000 (12:49 +0100)
commitebe7d65db55a09676d4435bc74b65d1f68603130
treebfee7ec5276ff50d7c9321e42eeed31ab45f1123
parentf5a133608a72a96b2023024043dc00480192bcc7
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