diff options
author | John Finlay <finlay@src.gnome.org> | 2004-11-16 05:27:01 +0000 |
---|---|---|
committer | John Finlay <finlay@src.gnome.org> | 2004-11-16 05:27:01 +0000 |
commit | 71a33c7ef725409b6bc6dd7c08e0ba8aecbe8861 (patch) | |
tree | c67edfce8e833db3ecb2c5af5e0d9f0d25a53fdd | |
parent | f6b80cf5cbc29bc1077663b790e1b36de47e66f9 (diff) | |
download | pygobject-71a33c7ef725409b6bc6dd7c08e0ba8aecbe8861.tar.gz |
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)
-rw-r--r-- | gobject/pygflags.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gobject/pygflags.c b/gobject/pygflags.c index d6388bb9..9e0fab3b 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("<flags %s of type %s>", tmp, - g_type_name(self->gtype)); + if (tmp) + retval = g_strdup_printf("<flags %s of type %s>", tmp, + g_type_name(self->gtype)); + else + retval = g_strdup_printf("<flags %ld of type %s>", self->parent.ob_ival, + g_type_name(self->gtype)); g_free(tmp); pyretval = PyString_FromString(retval); |