summaryrefslogtreecommitdiffstats
path: root/gobject/pygenum.c
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2004-07-20 11:05:41 +0000
committerJohan Dahlin <johan@src.gnome.org>2004-07-20 11:05:41 +0000
commitd2c71ff53b42afec6bf4ebca3bcf801dce5cfbb2 (patch)
tree8e24537a5847c6c93a0ef7ae12b8cdb2076e1839 /gobject/pygenum.c
parent7a068035003772b1c393c072377ebc8acfb875ae (diff)
downloadpygobject-d2c71ff53b42afec6bf4ebca3bcf801dce5cfbb2.tar.gz
pygobject-d2c71ff53b42afec6bf4ebca3bcf801dce5cfbb2.tar.xz
pygobject-d2c71ff53b42afec6bf4ebca3bcf801dce5cfbb2.zip
Simplify, fix name in exceptions and remove warning.
* gtk/gtk.override (_wrap_gtk_file_chooser_dialog_new): Simplify, fix name in exceptions and remove warning. * gobject/pygenum.c (pyg_enum_from_gtype): Fall back to int for unregistered enums. * gobject/pygflags.c (pyg_flags_from_gtype): Ditto * gobject/gobjectmodule.c (initgobject): Rename back to MainLoop, MainContext
Diffstat (limited to 'gobject/pygenum.c')
-rw-r--r--gobject/pygenum.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gobject/pygenum.c b/gobject/pygenum.c
index 0ccbb90..89f1616 100644
--- a/gobject/pygenum.c
+++ b/gobject/pygenum.c
@@ -131,7 +131,9 @@ pyg_enum_from_gtype (GType gtype, int value)
g_return_val_if_fail(gtype != G_TYPE_INVALID, NULL);
pyclass = (PyObject*)g_type_get_qdata(gtype, pygenum_class_key);
- g_assert(pyclass != NULL);
+ /* Fall back to int */
+ if (pyclass == NULL)
+ return PyInt_FromLong(value);
values = PyDict_GetItemString(((PyTypeObject *)pyclass)->tp_dict,
"__enum_values__");