diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-05-25 20:36:02 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-05-25 20:36:02 (GMT) |
commit | 2d16cca046ff80f2be3eea6934dd1dd8f4b807d1 (patch) | |
tree | 42c8a02ebea35d7e7fb55d14ba0d51d3877225e9 | |
parent | 2cc834e1f45f03bb64e5b18c2a1c9f7cc3a1e197 (diff) |
Been more verbose on Python loading failures.
-rw-r--r-- | plugins/pychrysalide/pychrysa.c | 21 |
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; } |