Projet

Général

Profil

0004-python-replace-exception-by-warning-on-logging-path-.patch

Benjamin Dauvergne, 19 juin 2020 21:12

Télécharger (1,31 ko)

Voir les différences:

Subject: [PATCH 4/6] python: replace exception by warning on logging path
 (#44287)

 bindings/python/wrapper_top.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
bindings/python/wrapper_top.c
709 709
	char *method = NULL;
710 710

  
711 711
	if (! logger_object) {
712
		PyErr_SetString(PyExc_RuntimeError, "neither lasso.logger nor "
713
				"logging.getLogger('lasso') did return a logger");
712
		PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "neither lasso.logger nor "
713
				 "logging.getLogger('lasso') did return a logger", 1);
714 714
		return;
715 715
	}
716 716
	switch (log_level) {
......
738 738
	if (result) {
739 739
		Py_DECREF(result);
740 740
	} else {
741
		PyErr_Format(PyExc_RuntimeError, "lasso could not call method %s on its logger",
742
				method);
741
		PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "lasso could not call method %s on its logger", method);
743 742
	}
744 743
}
745
-