summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gobject/gobjectmodule.c5
-rw-r--r--tests/test_subtype.py12
2 files changed, 13 insertions, 4 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 603ca23..002d117 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -1158,10 +1158,7 @@ pyg_type_register(PyTypeObject *class, char *type_name)
/* propagate new constructor API compatility flag from parent to child type */
has_new_constructor_api = g_type_get_qdata(parent_type,
pygobject_has_updated_constructor_key);
- if (has_new_constructor_api == NULL)
- g_warning("Constructor wrapper for %s needs to be updated to the new API",
- g_type_name(parent_type));
- else
+ if (has_new_constructor_api != NULL)
g_type_set_qdata(instance_type, pygobject_has_updated_constructor_key,
has_new_constructor_api);
diff --git a/tests/test_subtype.py b/tests/test_subtype.py
index 0de6074..a48452c 100644
--- a/tests/test_subtype.py
+++ b/tests/test_subtype.py
@@ -40,3 +40,15 @@ class TestSubType(unittest.TestCase):
refcount = testhelper.test_g_object_new()
self.assertEqual(refcount, 2)
+ def testMassiveGtkSubclassing(self):
+ for name, cls in [(name, getattr(gtk, name)) for name in dir(gtk)]:
+ ## Skip some deprecated types
+ if name in ['CTree', '_gobject']:
+ continue
+ try:
+ if not issubclass(cls, gobject.GObject):
+ continue
+ except TypeError: # raised by issubclass if cls is not a class
+ continue
+ subname = name + "PyGtkTestSubclass"
+ sub = type(subname, (cls,), {'__gtype_name__': subname })