From 71a33c7ef725409b6bc6dd7c08e0ba8aecbe8861 Mon Sep 17 00:00:00 2001 From: John Finlay Date: Tue, 16 Nov 2004 05:27:01 +0000 Subject: Print long int value if enum string not found. Fixes #158417. (modifed * gobject/pygflags.c (pyg_flags_repr): Print long int value if enum string not found. Fixes #158417. (modifed patch from Tim Evans) --- gobject/pygflags.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gobject/pygflags.c b/gobject/pygflags.c index d6388bb..9e0fab3 100644 --- a/gobject/pygflags.c +++ b/gobject/pygflags.c @@ -88,8 +88,12 @@ pyg_flags_repr(PyGFlags *self) tmp = generate_repr(self->gtype, self->parent.ob_ival); - retval = g_strdup_printf("", tmp, - g_type_name(self->gtype)); + if (tmp) + retval = g_strdup_printf("", tmp, + g_type_name(self->gtype)); + else + retval = g_strdup_printf("", self->parent.ob_ival, + g_type_name(self->gtype)); g_free(tmp); pyretval = PyString_FromString(retval); -- cgit