diff options
author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-05-07 21:48:21 +0000 |
---|---|---|
committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-05-07 21:48:21 +0000 |
commit | 4dff77b206af7f2c4bd4e799dcd42c907137dda3 (patch) | |
tree | 80b1c0d32c6f2702e5e94e76b1deb85e46cbffa5 /pangomodule.c | |
parent | 6eba847d4dac27ab3e195bd382e59ed7d3099f7f (diff) | |
download | pygtk-4dff77b206af7f2c4bd4e799dcd42c907137dda3.tar.gz |
Try to use pyg_add_warning_redirection and pyg_disable_warning_redirections if available.
Diffstat (limited to 'pangomodule.c')
-rw-r--r-- | pangomodule.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pangomodule.c b/pangomodule.c index f329c0ee..eb2ee435 100644 --- a/pangomodule.c +++ b/pangomodule.c @@ -33,6 +33,8 @@ void pypango_register_classes(PyObject *d); void pypango_add_constants(PyObject *module, const gchar *strip_prefix); extern PyMethodDef pypango_functions[]; +#ifndef pyg_add_warning_redirection + static void _log_func(const gchar *log_domain, GLogLevelFlags log_level, @@ -47,6 +49,9 @@ _log_func(const gchar *log_domain, pyg_gil_state_release(state); } +#endif + + DL_EXPORT(void) initpango(void) { @@ -86,6 +91,10 @@ initpango(void) /* add anything else to the module dictionary (such as constants) */ warning = PyErr_NewException("pango.PangoWarning", PyExc_Warning, NULL); PyDict_SetItemString(d, "Warning", warning); +#ifdef pyg_add_warning_redirection + pyg_add_warning_redirection("Pango", warning); +#else g_log_set_handler("Pango", G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING, _log_func, warning); +#endif } |