[gobject-introspection] scanner: Fix object hierarchy traversal in constructor scanning



commit 6172c268a98c7a2e478b78068ccdb3c23e80ce66
Author: Colin Walters <walters verbum org>
Date:   Wed Sep 8 11:56:25 2010 -0400

    scanner: Fix object hierarchy traversal in constructor scanning
    
    We weren't properly hitting GObject.

 giscanner/maintransformer.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 59f93e2..ae05195 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -835,14 +835,14 @@ method or constructor of some type."""
             return False
         if isinstance(target, ast.Class):
             parent = origin_node
-            while parent and (not parent.create_type().target_giname == 'GObject.Object'):
+            while parent and (not parent.gi_name == 'GObject.Object'):
                 if parent == target:
                     break
                 if parent.parent:
                     parent = self._transformer.lookup_typenode(parent.parent)
                 else:
                     parent = None
-                if parent is None:
+                if parent is None or parent.gi_name == 'GObject.Object':
                     message.warn_node(func,
                         "Return value is not superclass for constructor; "
                         "symbol=%r constructed=%r return=%r" % (



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]