diff options
author | Johan Dahlin <johan@src.gnome.org> | 2004-07-20 11:05:41 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2004-07-20 11:05:41 +0000 |
commit | d2c71ff53b42afec6bf4ebca3bcf801dce5cfbb2 (patch) | |
tree | 8e24537a5847c6c93a0ef7ae12b8cdb2076e1839 /gobject/pygenum.c | |
parent | 7a068035003772b1c393c072377ebc8acfb875ae (diff) | |
download | pygobject-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.c | 4 |
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__"); |