diff options
| author | Johan Dahlin <johan@gnome.org> | 2008-03-21 18:06:56 +0000 |
|---|---|---|
| committer | Johan Dahlin <johan@src.gnome.org> | 2008-03-21 18:06:56 +0000 |
| commit | 6ee167447336570b83e41ca2c4216d6e9058fd43 (patch) | |
| tree | 4d444ea4a3626cc1a5e34f717828f4e133c451f9 /gobject/__init__.py | |
| parent | 56a637d7d8b19277f2eb947a250385fd6bba9a4e (diff) | |
| download | pygobject-6ee167447336570b83e41ca2c4216d6e9058fd43.tar.gz pygobject-6ee167447336570b83e41ca2c4216d6e9058fd43.tar.xz pygobject-6ee167447336570b83e41ca2c4216d6e9058fd43.zip | |
Allow gobject.property work with subclasses. Add tests.
2008-03-21 Johan Dahlin <johan@gnome.org>
* gobject/__init__.py:
* tests/test_properties.py:
Allow gobject.property work with subclasses. Add tests.
(#523352, Tomeu Vizoso)
svn path=/trunk/; revision=752
Diffstat (limited to 'gobject/__init__.py')
| -rw-r--r-- | gobject/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gobject/__init__.py b/gobject/__init__.py index c1404f9..488d87e 100644 --- a/gobject/__init__.py +++ b/gobject/__init__.py @@ -57,15 +57,16 @@ class GObjectMeta(type): cls.__gproperties__ = gproperties - if (hasattr(cls, 'do_get_property') or - hasattr(cls, 'do_set_property')): + if ('do_get_property' in cls.__dict__ or + 'do_set_property' in cls.__dict__): for prop in props: if (prop.getter != prop._default_getter or prop.setter != prop._default_setter): raise TypeError( "GObject subclass %r defines do_get/set_property" " and it also uses a property which a custom setter" - " or getter. This is not allowed" % (cls,)) + " or getter. This is not allowed" % ( + cls.__name__,)) def obj_get_property(self, pspec): name = pspec.name.replace('-', '_') @@ -92,7 +93,6 @@ class GObjectMeta(type): return type_register(cls, namespace.get('__gtype_name__')) - _gobject._install_metaclass(GObjectMeta) del _gobject |
