diff options
author | Paul Pogonyshev <pogonyshev@gmx.net> | 2008-03-24 18:37:00 +0000 |
---|---|---|
committer | Paul Pogonyshev <paulp@src.gnome.org> | 2008-03-24 18:37:00 +0000 |
commit | f84de31b695944a29ec058a5b965242fbf15d051 (patch) | |
tree | 937a8ed3a0c59823c4c871527fe5d2266c06cc09 /gobject/pygenum.c | |
parent | 33a5962f1142d0abc22a084ee3e53d6a53012d00 (diff) | |
download | pygobject-f84de31b695944a29ec058a5b965242fbf15d051.tar.gz pygobject-f84de31b695944a29ec058a5b965242fbf15d051.tar.xz pygobject-f84de31b695944a29ec058a5b965242fbf15d051.zip |
Don't return NULL after warning; more useful warning message (bug
2008-03-24 Paul Pogonyshev <pogonyshev@gmx.net>
* gobject/pygenum.c (pyg_enum_richcompare): Don't return NULL
after warning; more useful warning message (bug #519631).
svn path=/trunk/; revision=755
Diffstat (limited to 'gobject/pygenum.c')
-rw-r--r-- | gobject/pygenum.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gobject/pygenum.c b/gobject/pygenum.c index 543bc49..876e464 100644 --- a/gobject/pygenum.c +++ b/gobject/pygenum.c @@ -30,14 +30,17 @@ static PyObject * pyg_enum_richcompare(PyGEnum *self, PyObject *other, int op) { + static char warning[256]; + if (!PyInt_Check(other)) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } if (PyObject_TypeCheck(other, &PyGEnum_Type) && ((PyGEnum*)other)->gtype != self->gtype) { - PyErr_Warn(PyExc_Warning, "comparing different enum types"); - return NULL; + g_snprintf(warning, sizeof(warning), "comparing different enum types: %s and %s", + g_type_name(self->gtype), g_type_name(((PyGEnum*)other)->gtype)); + PyErr_Warn(PyExc_Warning, warning); } return pyg_integer_richcompare((PyObject *)self, other, op); |