[git] GPGME - branch, master, updated. gpgme-1.6.0-209-g8a93f34
by Justus Winter
cvs at cvs.gnupg.org
Fri Jul 8 11:46:51 CEST 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".
The branch, master has been updated
via 8a93f345b701332270c9829a4d0a93537f98a8d8 (commit)
from 52efcf1ee9fc8ba4c6bd23d8fe4f5f7993ba9fb1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8a93f345b701332270c9829a4d0a93537f98a8d8
Author: Justus Winter <justus at g10code.com>
Date: Fri Jul 8 11:45:08 2016 +0200
python: Fix raising stashed exceptions.
Fixes an issue with newer versions of Python.
* lang/python/helpers.c (pygpgme_raise_callback_exception): Be more
careful when restoring the exception.
Signed-off-by: Justus Winter <justus at g10code.com>
diff --git a/lang/python/helpers.c b/lang/python/helpers.c
index 1b66146..43a55d0 100644
--- a/lang/python/helpers.c
+++ b/lang/python/helpers.c
@@ -150,12 +150,18 @@ PyObject *pygpgme_raise_callback_exception(PyObject *self)
else
Py_INCREF(ptraceback);
+ /* We now have references for the extracted items. */
Py_DECREF(excinfo);
- PyErr_Restore(ptype, pvalue, ptraceback);
+ /* Clear the exception information. It is important to do this
+ before setting the error, because setting the attribute may
+ execute python code, and the runtime system raises a SystemError
+ if an exception is set but values are returned. */
Py_INCREF(Py_None);
PyObject_SetAttrString(self, EXCINFO, Py_None);
+ /* Restore exception. */
+ PyErr_Restore(ptype, pvalue, ptraceback);
return NULL; /* Raise exception. */
leave:
-----------------------------------------------------------------------
Summary of changes:
lang/python/helpers.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list