diff options
| author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2005-05-29 14:04:00 +0000 |
|---|---|---|
| committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2005-05-29 14:04:00 +0000 |
| commit | c91990e15aa4df649f90424d93c45e9bc8e0909b (patch) | |
| tree | 24b6a3a4f63b62943958804d993f2e1c8d949322 | |
| parent | d71bf818c542794d00043142084d13d6915d94f1 (diff) | |
| download | pygobject-c91990e15aa4df649f90424d93c45e9bc8e0909b.tar.gz pygobject-c91990e15aa4df649f90424d93c45e9bc8e0909b.tar.xz pygobject-c91990e15aa4df649f90424d93c45e9bc8e0909b.zip | |
fix registration of already registered types through the gobject metaclass
| -rw-r--r-- | gobject/pygobject.c | 9 |
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; } |
