Module: kamailio Branch: master Commit: 829941d0079cb7f46a20ec975252790fd17019ba URL: https://github.com/kamailio/kamailio/commit/829941d0079cb7f46a20ec975252790f...
Author: AnthonyA ascanio.alba7@gmail.com Committer: AnthonyA ascanio.alba7@gmail.com Date: 2018-03-03T01:02:48+08:00
app_python3: don't hide the real exception on load failure
- don't call PyErr_PrintEx() as this clears the error indicator
---
Modified: src/modules/app_python3/app_python_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/829941d0079cb7f46a20ec975252790f... Patch: https://github.com/kamailio/kamailio/commit/829941d0079cb7f46a20ec975252790f...
---
diff --git a/src/modules/app_python3/app_python_mod.c b/src/modules/app_python3/app_python_mod.c index e851b105d7..06d7a9d6f2 100644 --- a/src/modules/app_python3/app_python_mod.c +++ b/src/modules/app_python3/app_python_mod.c @@ -300,7 +300,6 @@ int apy_reload_script(void) PY_GIL_ENSURE PyObject *pModule = PyImport_ReloadModule(_sr_apy_module); if (!pModule) { - PyErr_PrintEx(0); if (!PyErr_Occurred()) PyErr_Format(PyExc_ImportError, "Reload module '%s'", bname); python_handle_exception("mod_init"); @@ -408,7 +407,6 @@ int apy_load_script(void)
pModule = PyImport_ImportModule(bname); if (pModule == NULL) { - PyErr_PrintEx(0); if (!PyErr_Occurred()) PyErr_Format(PyExc_ImportError, "No module named '%s'", bname); python_handle_exception("mod_init");