python: Release the GIL during calls into GPGME.
authorJustus Winter <justus@g10code.com>
Fri, 16 Sep 2016 10:32:24 +0000 (12:32 +0200)
committerJustus Winter <justus@g10code.com>
Fri, 16 Sep 2016 13:56:47 +0000 (15:56 +0200)
commit6af7bee076bacbc0cdfe7de342bce43ca5671b3b
treeeb6f1d9c0a6344c5b631fe23d674b8a2abc197c1
parenta458e7fe2006d92bd5a838e2747fb66bbac4b1b8
python: Release the GIL during calls into GPGME.

* lang/python/helpers.c (pyme_raise_callback_exception): Re-acquire
the Global Interpreter Lock.
(pyPassphraseCb, pyme_set_passphrase_cb, pyProgressCb,
pyme_set_progress_cb, pyStatusCb, pyme_set_status_cb,
_pyme_interact_cb, pyDataReadCb, pyDataWriteCb, pyDataSeekCb,
pyDataReleaseCb, pyme_data_new_from_cbs, _pyme_assuan_data_cb,
_pyme_assuan_inquire_cb, _pyme_assuan_status_cb): Likewise.
* lang/python/setup.py.in: Make 'gpgme-config' emit the correct
cflags, and SWIG generate code to release the GIL before calling us.

Co-authored-by: Kai Michaelis <kai@gnupg.org>
Signed-off-by: Justus Winter <justus@g10code.com>
lang/python/helpers.c
lang/python/setup.py.in