summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/pychrysalide/pychrysa.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/plugins/pychrysalide/pychrysa.c b/plugins/pychrysalide/pychrysa.c
index df6cc9a..96d61ae 100644
--- a/plugins/pychrysalide/pychrysa.c
+++ b/plugins/pychrysalide/pychrysa.c
@@ -486,21 +486,21 @@ PyMODINIT_FUNC PyInit_pychrysalide(void)
}
if (!is_current_abi_suitable())
- return NULL;
+ goto exit;
if (pygobject_init(-1, -1, -1) == NULL)
{
PyErr_SetString(PyExc_SystemError, "unable to init GObject in Python.");
- return NULL;
+ goto exit;
}
if (!set_version_for_gtk_namespace("3.0"))
- return NULL;
+ goto exit;
if (!load_all_basic_components())
{
PyErr_SetString(PyExc_SystemError, "unable to load all basic components.");
- return NULL;
+ goto exit;
}
/* Mise en place des fonctionnalités offertes */
@@ -545,7 +545,9 @@ PyMODINIT_FUNC PyInit_pychrysalide(void)
if (!status)
{
PyErr_SetString(PyExc_SystemError, "failed to load all PyChrysalide components.");
- return NULL;
+ Py_DECREF(result);
+ result = NULL;
+ goto exit;
}
if (_standalone)
@@ -555,7 +557,9 @@ PyMODINIT_FUNC PyInit_pychrysalide(void)
if (ret == -1)
{
PyErr_SetString(PyExc_SystemError, "failed to register a cleanup function.");
- return NULL;
+ Py_DECREF(result);
+ result = NULL;
+ goto exit;
}
/**
@@ -595,6 +599,11 @@ PyMODINIT_FUNC PyInit_pychrysalide(void)
}
+ exit:
+
+ if (result == NULL && !_standalone)
+ log_pychrysalide_exception("Loading failed");
+
return result;
}