aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/helpers.c
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-05-19 08:49:43 +0000
committerJustus Winter <[email protected]>2016-05-19 09:09:45 +0000
commit07f71cd17706093ca6b1507c41609356d479ae9f (patch)
treea03d2f8ee897aeaa90f8f3a2e0a1543f13a53d80 /lang/python/helpers.c
parentQt: Fix compilation of unit tests (diff)
downloadgpgme-07f71cd17706093ca6b1507c41609356d479ae9f.tar.gz
gpgme-07f71cd17706093ca6b1507c41609356d479ae9f.zip
python: Fix import.
* lang/python/helpers.c (pygpgme_exception_init): Make module import relative. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/helpers.c')
-rw-r--r--lang/python/helpers.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lang/python/helpers.c b/lang/python/helpers.c
index 96c844fb..285b1da4 100644
--- a/lang/python/helpers.c
+++ b/lang/python/helpers.c
@@ -29,7 +29,10 @@ static PyObject *GPGMEError = NULL;
void pygpgme_exception_init(void) {
if (GPGMEError == NULL) {
PyObject *errors;
- errors = PyImport_ImportModule("errors");
+ PyObject *from_list = PyList_New(0);
+ errors = PyImport_ImportModuleLevel("errors", PyEval_GetGlobals(),
+ PyEval_GetLocals(), from_list, 1);
+ Py_XDECREF(from_list);
if (errors) {
GPGMEError=PyDict_GetItemString(PyModule_GetDict(errors), "GPGMEError");
Py_XINCREF(GPGMEError);