[sr-dev] git:master:310c60cb: app_python: don't hide the real exception on load failure

Daniel-Constantin Mierla miconda at gmail.com
Fri Mar 2 21:00:09 CET 2018


Module: kamailio
Branch: master
Commit: 310c60cb34641f73ac0e8b48c9bf68efa5fb3533
URL: https://github.com/kamailio/kamailio/commit/310c60cb34641f73ac0e8b48c9bf68efa5fb3533

Author: AnthonyA <ascanio.alba7 at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-03-02T21:00:00+01:00

app_python: don't hide the real exception on load failure

- don't call PyErr_PrintEx() as this clears the error indicator

---

Modified: src/modules/app_python/app_python_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/310c60cb34641f73ac0e8b48c9bf68efa5fb3533.diff
Patch: https://github.com/kamailio/kamailio/commit/310c60cb34641f73ac0e8b48c9bf68efa5fb3533.patch

---

diff --git a/src/modules/app_python/app_python_mod.c b/src/modules/app_python/app_python_mod.c
index 78cee45c66..98738ee66c 100644
--- a/src/modules/app_python/app_python_mod.c
+++ b/src/modules/app_python/app_python_mod.c
@@ -287,7 +287,7 @@ int apy_reload_script(void)
 	PY_GIL_ENSURE;
 	pModule = PyImport_ReloadModule(_sr_apy_module);
 	if (!pModule) {
-                PyErr_PrintEx(0);
+                // PyErr_PrintEx(0); - don't hide the real exception
 		if (!PyErr_Occurred())
 			PyErr_Format(PyExc_ImportError, "Reload module '%s'", bname);
 		python_handle_exception("mod_init");




More information about the sr-dev mailing list