summaryrefslogtreecommitdiffstats
path: root/gobject
diff options
context:
space:
mode:
Diffstat (limited to 'gobject')
-rw-r--r--gobject/pygobject.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gobject/pygobject.c b/gobject/pygobject.c
index 691b1f1..a6efa3f 100644
--- a/gobject/pygobject.c
+++ b/gobject/pygobject.c
@@ -1249,9 +1249,16 @@ PyTypeObject PyGObject_Type = {
static int
pygobjectmeta_init(PyTypeObject *subtype, PyObject *args, PyObject *kwargs)
{
+ PyObject *instance_dict;
if (PyType_Type.tp_init((PyObject *) subtype, args, kwargs))
return -1;
- return pyg_type_register(subtype);
+ instance_dict = PyTuple_GetItem(args, 2);
+ if (instance_dict) {
+ if (PyDict_GetItemString(instance_dict, "__gtype__") == NULL)
+ return pyg_type_register(subtype);
+ } else
+ PyErr_Clear();
+ return 0;
}