diff options
author | Justus Winter <[email protected]> | 2016-05-19 09:03:27 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2016-05-19 13:58:45 +0000 |
commit | d90857a08c4fe5b73b6d6d46fd6200efdd72db44 (patch) | |
tree | 93ce7fab9855dfa66bf0d1f45cba4010d3eba1af /lang/python/helpers.h | |
parent | Qt: Check for graphviz and set HAVE_DOT correctly (diff) | |
download | gpgme-d90857a08c4fe5b73b6d6d46fd6200efdd72db44.tar.gz gpgme-d90857a08c4fe5b73b6d6d46fd6200efdd72db44.zip |
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 <[email protected]>
Diffstat (limited to 'lang/python/helpers.h')
-rw-r--r-- | lang/python/helpers.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lang/python/helpers.h b/lang/python/helpers.h index 12d7cfa2..81d17ffa 100644 --- a/lang/python/helpers.h +++ b/lang/python/helpers.h @@ -30,6 +30,7 @@ void pygpgme_exception_init(void); gpgme_error_t pygpgme_exception2code(void); void pygpgme_clear_generic_cb(PyObject **cb); +PyObject *pygpgme_raise_callback_exception(PyObject *self); void pygpgme_set_passphrase_cb(gpgme_ctx_t ctx, PyObject *cb, PyObject **freelater); |