From f3e8d8a4518de2768692e0b392262d0da6d0fd84 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 21 Mar 2017 12:32:31 +0100 Subject: python: Wrap 'gpgme_op_keylist_from_data_start'. * NEWS: Update. * lang/python/gpg/core.py (Context.keylist): New keyword argument 'source'. If given, list keys from 'source'. * lang/python/gpgme.i: Wrap the argument to 'gpgme_op_keylist_from_data_start'. * lang/python/tests/Makefile.am (py_tests): Add new test. * lang/python/tests/support.py (EphemeralContext): Do not throw an error if no agent has been started in the context. * lang/python/tests/t-keylist-from-data.py: New file. Signed-off-by: Justus Winter --- lang/python/tests/support.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lang/python/tests/support.py') diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py index 611986b9..680300c1 100644 --- a/lang/python/tests/support.py +++ b/lang/python/tests/support.py @@ -109,7 +109,13 @@ def EphemeralContext(): agent_socket = os.path.join(tmp, "S.gpg-agent") ctx.protocol = gpg.constants.protocol.ASSUAN ctx.set_engine_info(ctx.protocol, file_name=agent_socket) - ctx.assuan_transact(["KILLAGENT"]) + try: + ctx.assuan_transact(["KILLAGENT"]) + except gpg.errors.GPGMEError as e: + if e.getcode() == gpg.errors.ASS_CONNECT_FAILED: + pass # the agent was not running + else: + raise # Block until it is really gone. while os.path.exists(agent_socket): -- cgit v1.2.3