diff options
Diffstat (limited to 'gobject/pygobject.c')
-rw-r--r-- | gobject/pygobject.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gobject/pygobject.c b/gobject/pygobject.c index b4274e1..222280b 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -29,6 +29,8 @@ #include "pyginterface.h" #include "pygparamspec.h" +#include "pygi-external.h" + static void pygobject_dealloc(PyGObject *self); static int pygobject_traverse(PyGObject *self, visitproc visit, void *arg); @@ -871,6 +873,14 @@ pygobject_lookup_class(GType gtype) py_type = g_type_get_qdata(gtype, pygobject_class_key); if (py_type == NULL) { py_type = g_type_get_qdata(gtype, pyginterface_type_key); + + if (py_type == NULL) { + py_type = (PyTypeObject *)pygi_type_import_by_g_type(gtype); + if (py_type == NULL) { + PyErr_Clear(); + } + } + if (py_type == NULL) { py_type = pygobject_new_with_interfaces(gtype); g_type_set_qdata(gtype, pyginterface_type_key, py_type); |