diff options
author | Johan Dahlin <johan@src.gnome.org> | 2004-08-06 15:56:53 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2004-08-06 15:56:53 +0000 |
commit | bf6a98e9b90b99cbc12e84be278dddbf697087f1 (patch) | |
tree | 66291ad6bec95a368f9cc2668d8f04ddf7b2ff4d /gobject/pygflags.c | |
parent | 8b75bb80e67b43202aa75f8ca075a21a11e9f574 (diff) | |
download | pygobject-bf6a98e9b90b99cbc12e84be278dddbf697087f1.tar.gz pygobject-bf6a98e9b90b99cbc12e84be278dddbf697087f1.tar.xz pygobject-bf6a98e9b90b99cbc12e84be278dddbf697087f1.zip |
Don't comment out the fallback, it break the test. (Wow, the testsuitePYGTK_2_3_96
* gobject/pygflags.c (pyg_flags_from_gtype): Don't comment out the
fallback, it break the test. (Wow, the testsuite caught another bug!)
* tests/enum.py: Additional tests.
* gobject/pygenum.c (pyg_enum_repr): Don't use g_enum_get_value,
use enum_class->values[n].value_name instead. Also check if the
value is NULL or not. This makes gtk.icon_size_register work a
little bit better.
Diffstat (limited to 'gobject/pygflags.c')
-rw-r--r-- | gobject/pygflags.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/gobject/pygflags.c b/gobject/pygflags.c index 526368a..98e3a9e 100644 --- a/gobject/pygflags.c +++ b/gobject/pygflags.c @@ -80,8 +80,7 @@ pyg_flags_repr(PyGFlags *self) char *tmp, *retval; PyObject *pyretval; - tmp = generate_repr(self->gtype, - self->parent.ob_ival); + tmp = generate_repr(self->gtype, self->parent.ob_ival); retval = g_strdup_printf("<flags %s of type %s>", tmp, g_type_name(self->gtype)); @@ -169,15 +168,11 @@ pyg_flags_from_gtype (GType gtype, int value) if (!retval) { PyErr_Clear(); - return PyInt_FromLong(value); -#if 0 - /* This breaks repr */ retval = ((PyTypeObject *)pyclass)->tp_alloc((PyTypeObject *)pyclass, 0); g_assert(retval != NULL); ((PyIntObject*)retval)->ob_ival = value; ((PyGFlags*)retval)->gtype = gtype; -#endif } Py_INCREF(retval); |