summaryrefslogtreecommitdiffstats
path: root/gobject/pygboxed.c
diff options
context:
space:
mode:
Diffstat (limited to 'gobject/pygboxed.c')
-rw-r--r--gobject/pygboxed.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gobject/pygboxed.c b/gobject/pygboxed.c
index eb274a2..8a4c8a8 100644
--- a/gobject/pygboxed.c
+++ b/gobject/pygboxed.c
@@ -28,6 +28,8 @@
#include "pygobject-private.h"
#include "pygboxed.h"
+#include "pygi-external.h"
+
GQuark pygboxed_type_key;
GQuark pygboxed_marshal_key;
@@ -182,6 +184,14 @@ pyg_boxed_new(GType boxed_type, gpointer boxed, gboolean copy_boxed,
}
tp = g_type_get_qdata(boxed_type, pygboxed_type_key);
+
+ if (tp == NULL) {
+ tp = (PyTypeObject *)pygi_type_import_by_g_type(boxed_type);
+ if (tp == NULL) {
+ PyErr_Clear();
+ }
+ }
+
if (!tp)
tp = (PyTypeObject *)&PyGBoxed_Type; /* fallback */
self = PyObject_NEW(PyGBoxed, tp);