summaryrefslogtreecommitdiffstats
path: root/gobject/__init__.py
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@async.com.br>2008-05-23 16:54:58 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-05-23 16:54:58 +0000
commita1c2bc60bd137b0faecb75a22f8c96c952c4ada4 (patch)
tree9c89705e7632e3579bbc68890da086a493f0e810 /gobject/__init__.py
parent4689542d67328249508d78bc463866cd2a20fe34 (diff)
Merge from trunk:
2008-05-23 Johan Dahlin <jdahlin@async.com.br> Merge from trunk: * gobject/__init__.py: * tests/test_properties.py: Allow gobject.property work with subclasses. Add tests. (#523352, Tomeu Vizoso) * gobject/pygsource.c: * tests/test_source.py: Unbreak Source.prepare (#523075, Bryan Silverthorn) * gobject/gobjectmodule.c (REGISTER_TYPE): Never override customly set 'tp_new' and 'tp_alloc'. * configure.ac: Don't link against libffi if we cannot find libffi on the system. (#496006, Ed Catmur) * Makefile.am: Dist .m4 files. (#496011, Ed Catmur) * gobject/pygenum.c (pyg_enum_richcompare): Don't return NULL after warning; more useful warning message (bug #519631). svn path=/branches/pygobject-2-14/; revision=781
Diffstat (limited to 'gobject/__init__.py')
-rw-r--r--gobject/__init__.py8
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