diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | gobject/pygtype.c | 10 |
2 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,10 @@ +2009-04-17 Paul Pogonyshev <pogonyshev@gmx.net> + + Bug 568499 – CellRendererPixbuf stock-size property has wrong type + + * gobject/pygtype.c (pyg_enum_get_value): Also accept long + integers. + 2009-04-15 Götz Waschk <waschk@mandriva.org> Bug 550231 – missing dep on libffi in pygobject-2.0.pc diff --git a/gobject/pygtype.c b/gobject/pygtype.c index a9b18a4..601ea83 100644 --- a/gobject/pygtype.c +++ b/gobject/pygtype.c @@ -422,6 +422,16 @@ pyg_enum_get_value(GType enum_type, PyObject *obj, gint *val) g_type_name(enum_type), g_type_name(((PyGEnum *) obj)->gtype)); } + /* Dumb code duplication, but probably not worth it to have yet another macro. */ + } else if (PyLong_Check(obj)) { + *val = PyLong_AsLong(obj); + res = 0; + + if (PyObject_TypeCheck(obj, &PyGEnum_Type) && ((PyGEnum *) obj)->gtype != enum_type) { + g_warning("expected enumeration type %s, but got %s instead", + g_type_name(enum_type), + g_type_name(((PyGEnum *) obj)->gtype)); + } } else if (_PyUnicode_Check(obj)) { GEnumValue *info; char *str = _PyUnicode_AsString(obj); |