summaryrefslogtreecommitdiffstats
path: root/gobject/pygenum.c
diff options
context:
space:
mode:
authorPaul Pogonyshev <pogonyshev@gmx.net>2008-04-27 18:47:56 +0000
committerPaul Pogonyshev <paulp@src.gnome.org>2008-04-27 18:47:56 +0000
commit486a4d74244dcb7277710b8139f16be46a06492a (patch)
treeef0f7335f4a0112682ed0b9cd415a4ea41541e30 /gobject/pygenum.c
parent8ea1bbdbd9b9e44e61e132b9cdc92517adff35a8 (diff)
downloadpygobject-486a4d74244dcb7277710b8139f16be46a06492a.tar.gz
pygobject-486a4d74244dcb7277710b8139f16be46a06492a.tar.xz
pygobject-486a4d74244dcb7277710b8139f16be46a06492a.zip
Fix: raise warning as exception if asked by PyErr_Warn().
2008-04-27 Paul Pogonyshev <pogonyshev@gmx.net> * gobject/pygenum.c (pyg_enum_richcompare): Fix: raise warning as exception if asked by PyErr_Warn(). * gobject/pygflags.c (pyg_flags_richcompare): Don't return NULL after warning; more useful warning message. (#480424, borrowing code by Mark Doffman) svn path=/trunk/; revision=779
Diffstat (limited to 'gobject/pygenum.c')
-rw-r--r--gobject/pygenum.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gobject/pygenum.c b/gobject/pygenum.c
index 2d6c544..7de2b3b 100644
--- a/gobject/pygenum.c
+++ b/gobject/pygenum.c
@@ -40,7 +40,8 @@ pyg_enum_richcompare(PyGEnum *self, PyObject *other, int op)
if (PyObject_TypeCheck(other, &PyGEnum_Type) && ((PyGEnum*)other)->gtype != self->gtype) {
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);
+ if (PyErr_Warn(PyExc_Warning, warning))
+ return NULL;
}
return pyg_integer_richcompare((PyObject *)self, other, op);