diff options
| author | Johan Dahlin <johan@src.gnome.org> | 2006-11-18 12:58:43 +0000 |
|---|---|---|
| committer | Johan Dahlin <johan@src.gnome.org> | 2006-11-18 12:58:43 +0000 |
| commit | f27cb5674c9526d1f1fc4537bd4612c42d9dce4d (patch) | |
| tree | 189cf64e50a7b11160cf831f122a33ed4c252470 /gobject | |
| parent | 2de07b5d97911346eb95ded4f86d1d274cca8a0a (diff) | |
| download | pygobject-f27cb5674c9526d1f1fc4537bd4612c42d9dce4d.tar.gz pygobject-f27cb5674c9526d1f1fc4537bd4612c42d9dce4d.tar.xz pygobject-f27cb5674c9526d1f1fc4537bd4612c42d9dce4d.zip | |
Use PyObject_Cmp instead of comparing function closure addresses, which
* gobject/pygtype.c (gclosure_from_pyfunc): Use PyObject_Cmp instead
of comparing function closure addresses, which makes it possible
to use any callable and not just functions. Fixes #375589 (Dima)
Diffstat (limited to 'gobject')
| -rw-r--r-- | gobject/pygtype.c | 5 |
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; } } |
