summaryrefslogtreecommitdiffstats
path: root/gobject
diff options
context:
space:
mode:
Diffstat (limited to 'gobject')
-rw-r--r--gobject/pygtype.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gobject/pygtype.c b/gobject/pygtype.c
index 2146978..5bc29b5 100644
--- a/gobject/pygtype.c
+++ b/gobject/pygtype.c
@@ -1331,8 +1331,9 @@ gclosure_from_pyfunc(PyGObject *object, PyObject *func)
for (l = object->closures; l; l = l->next) {
PyGClosure *pyclosure = l->data;
- if (PyFunction_GetClosure(pyclosure->callback) ==
- PyFunction_GetClosure(func)) {
+ int res;
+ PyObject_Cmp(pyclosure->callback, func, &res);
+ if (!res) {
return (GClosure*)pyclosure;
}
}