so that no python exceptions remain after the do_python_single call.
Otherwise the next request will immediately fail.
Patch from #5242, but separated out to keep commit history
a little clearer.
ERROR("%s:%d, vp->da->name: %s", __func__, __LINE__, vp->da->name);
if (PyErr_Occurred()) {
python_error_log();
+ PyErr_Clear();
}
return -1;
ERROR("%s:%d, %s - pRet is NULL", __func__, __LINE__, funcname);
if (PyErr_Occurred()) {
python_error_log();
+ PyErr_Clear();
}
ret = RLM_MODULE_FAIL;
goto finish;
if (ret == RLM_MODULE_FAIL) {
ERROR("%s:%d, %s - RLM_MODULE_FAIL", __func__, __LINE__, funcname);
}
+
+ if (PyErr_Occurred()) {
+ ERROR("Unhandled Python exception (see below); clearing.");
+ python_error_log();
+ PyErr_Clear();
+ }
+
return ret;
}