From d90857a08c4fe5b73b6d6d46fd6200efdd72db44 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 19 May 2016 11:03:27 +0200 Subject: python: Robust exception handling in callbacks. * lang/python/helpers.c (pygpgme_stash_callback_exception): New function. (pygpgme_raise_callback_exception): Likewise. (pyPassphraseCb): Stash python errors. * lang/python/helpers.h (pygpgme_raise_callback_exception): New prototype. * lang/python/pyme/core.py ({Context,Data}.__init__): Move common initialization to superclass. (Context.set_progress_cb): Hand in 'self'. * lang/python/pyme/util.py (GpgmeWrapper.__init__): New function. (GpgmeWrapper.__getattr__): Raise stashed exceptions. * lang/python/tests/Makefile.am (py_tests): Add new test. * lang/python/tests/t-callbacks.py: New file. Signed-off-by: Justus Winter --- lang/python/tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'lang/python/tests/Makefile.am') diff --git a/lang/python/tests/Makefile.am b/lang/python/tests/Makefile.am index c4fc6029..30f1aec6 100644 --- a/lang/python/tests/Makefile.am +++ b/lang/python/tests/Makefile.am @@ -29,6 +29,7 @@ TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) \ PYTHONPATH=`echo $(abs_builddir)/../build/lib.*` py_tests = t-wrapper.py \ + t-callbacks.py \ t-data.py \ t-encrypt.py \ t-encrypt-sym.py \ -- cgit v1.2.3