pygobject r755 - in trunk: . gobject



Author: paulp
Date: Mon Mar 24 18:37:00 2008
New Revision: 755
URL: http://svn.gnome.org/viewvc/pygobject?rev=755&view=rev

Log:
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).


Modified:
   trunk/ChangeLog
   trunk/gobject/pygenum.c

Modified: trunk/gobject/pygenum.c
==============================================================================
--- trunk/gobject/pygenum.c	(original)
+++ trunk/gobject/pygenum.c	Mon Mar 24 18:37:00 2008
@@ -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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]