From: Holger Berndt Date: Sun, 15 Mar 2015 20:24:29 +0000 (+0100) Subject: Python plugin: Silence parasite glib warnings X-Git-Tag: 3.12.0~165 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=de6f18826fe06f2592e2436b70a340cb20241df0;ds=sidebyside Python plugin: Silence parasite glib warnings --- diff --git a/src/plugins/python/python_plugin.c b/src/plugins/python/python_plugin.c index 69d7e5806..2ce32f35d 100644 --- a/src/plugins/python/python_plugin.c +++ b/src/plugins/python/python_plugin.c @@ -637,9 +637,14 @@ done: return retval ? retval : g_strdup("Unspecified error occured"); } +static void log_func(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) +{ +} gint plugin_init(gchar **error) { + guint log_handler; + int parasite_retval; PyObject *inst_StringIO = NULL; /* Version check */ @@ -678,7 +683,10 @@ gint plugin_init(gchar **error) } /* initialize python interactive shell */ - if(!parasite_python_init(error)) { + log_handler = g_log_set_handler(NULL, G_LOG_LEVEL_WARNING | G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO, log_func, NULL); + parasite_retval = parasite_python_init(error); + g_log_remove_handler(NULL, log_handler); + if(!parasite_retval) { goto err; }