Home GnuPG

python: Make 'get_key' more idiomatic.

Description

python: Make 'get_key' more idiomatic.

* lang/python/pyme/core.py (Context.get_key): Raise errors.KeyNotFound
if the key is not found.  This error is both a KeyError for idiomatic
error handling as well as a GPGMEError so we don't break existing
code.
* lang/python/pyme/errors.py (KeyNotFound): New class.
* lang/python/tests/support.py (no_such_key): New variable.
* lang/python/tests/t-keylist.py: Test the new behavior.
  • Signed-off-by: Justus Winter <justus@g10code.com>

Details

Provenance
justusAuthored on Oct 13 2016, 1:13 PM
Parents
rGPGMEPY66f0e7c6d0b1: python: Return public keys by default.
Branches
Unknown
Tags
Unknown

Event Timeline