diff options
author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-01-14 17:51:47 +0000 |
---|---|---|
committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-01-14 17:51:47 +0000 |
commit | cb01e059cd106143137e9531978b5e157234a557 (patch) | |
tree | 56ce4beb8c0d90a1916dc8b0566127bd4e53a39f | |
parent | d6f96e778586ad09e1dad7e17cab9e841ab96ecf (diff) | |
download | pygobject-cb01e059cd106143137e9531978b5e157234a557.tar.gz pygobject-cb01e059cd106143137e9531978b5e157234a557.tar.xz pygobject-cb01e059cd106143137e9531978b5e157234a557.zip |
Warn if io callback returns None: almost always this is an error
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gobject/gobjectmodule.c | 6 |
2 files changed, 11 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2006-01-14 Gustavo J. A. M. Carneiro <gjc@gnome.org> + + * gobject/gobjectmodule.c (iowatch_marshal): Warn if io callback + returns None: almost always this is an error. + 2006-01-13 Gustavo J. A. M. Carneiro <gjc@gnome.org> * gobject/pygobject.c (pygobject_register_class): Change strategy diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 6e00ceb..37d2e4c 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -1921,6 +1921,12 @@ iowatch_marshal(GIOChannel *source, GIOCondition condition, gpointer user_data) PyErr_Print(); res = FALSE; } else { + if (ret == Py_None) { + if (PyErr_Warn(PyExc_Warning, "gobject.io_add_watch callback returned None;" + " should return True/False")) { + PyErr_Print(); + } + } res = PyObject_IsTrue(ret); Py_DECREF(ret); } |