From a799fbc43fc912d0e21d230e9c7b76472c74c106 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 19 Jun 2020 21:05:23 +0200 Subject: [PATCH 04/21] python: replace exception by warning on logging path (#44287) --- bindings/python/wrapper_top.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bindings/python/wrapper_top.c b/bindings/python/wrapper_top.c index 10b417d2..7c98ef1e 100644 --- a/bindings/python/wrapper_top.c +++ b/bindings/python/wrapper_top.c @@ -709,8 +709,8 @@ lasso_python_log(const char *domain, GLogLevelFlags log_level, const gchar *mess char *method = NULL; if (! logger_object) { - PyErr_SetString(PyExc_RuntimeError, "neither lasso.logger nor " - "logging.getLogger('lasso') did return a logger"); + PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "neither lasso.logger nor " + "logging.getLogger('lasso') did return a logger", 1); return; } switch (log_level) { @@ -738,7 +738,6 @@ lasso_python_log(const char *domain, GLogLevelFlags log_level, const gchar *mess if (result) { Py_DECREF(result); } else { - PyErr_Format(PyExc_RuntimeError, "lasso could not call method %s on its logger", - method); + PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "lasso could not call method %s on its logger", method); } } -- 2.26.2