summaryrefslogtreecommitdiffstats
path: root/gobject/pygenum.c
diff options
context:
space:
mode:
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__");