summaryrefslogtreecommitdiffstats
path: root/gobject
diff options
context:
space:
mode:
authorMark McLoughlin <mark@skynet.ie>2005-05-09 20:01:40 +0000
committerJohan Dahlin <johan@src.gnome.org>2005-05-09 20:01:40 +0000
commit46323c8148108e48abf6725646c5ab68406f2a8f (patch)
tree4c5df1f3f3b7f72e52c000f803dfc324b139a1da /gobject
parentd00fbae42480e2fa0b911d386d45fd8e046eef88 (diff)
downloadpygobject-46323c8148108e48abf6725646c5ab68406f2a8f.tar.gz
pygobject-46323c8148108e48abf6725646c5ab68406f2a8f.tar.xz
pygobject-46323c8148108e48abf6725646c5ab68406f2a8f.zip
Fix for bug #303573 - "exceptions raised in a child watch handler are
2005-05-09 Mark McLoughlin <mark@skynet.ie> Fix for bug #303573 - "exceptions raised in a child watch handler are silently swallowed" * gobject/gobjectmodule.c: (child_watch_func), (_pyg_spawn_async_callback): if PyObject_CallFunction() returns NULL, print a traceback of the exception. * tests/test_mainloop.py: add testcase. * tests/Makefile.am: add test_mainloop.py Reviewed by Johan Dahlin <johan@gnome.org>
Diffstat (limited to 'gobject')
-rw-r--r--gobject/gobjectmodule.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 0f1ba8f..10aea45 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -1832,7 +1832,12 @@ child_watch_func(GPid pid, gint status, gpointer data)
child_data->data);
else
retval = PyObject_CallFunction(child_data->func, "ii", pid, status);
- Py_XDECREF(retval);
+
+ if (retval)
+ Py_DECREF(retval);
+ else
+ PyErr_Print();
+
pyg_gil_state_release(gil);
}
@@ -1894,7 +1899,10 @@ _pyg_spawn_async_callback(gpointer user_data)
retval = PyObject_CallFunction(data->func, "O", data->data);
else
retval = PyObject_CallFunction(data->func, NULL);
- Py_XDECREF(retval);
+ if (retval)
+ Py_DECREF(retval);
+ else
+ PyErr_Print();
Py_DECREF(data->func);
Py_XDECREF(data->data);
g_free(data);