[gobject-introspection] scanner: Don't clear out ctype on annotation strings if we fail to resolve



commit 9ca497c7d85336358e856c4410de036cd7169d3a
Author: Colin Walters <walters verbum org>
Date:   Fri Sep 3 19:27:38 2010 -0400

    scanner: Don't clear out ctype on annotation strings if we fail to resolve
    
    We don't have an "annotation source" for Type right now; so as a quick
    hack, stuff it in the ctype but only if we fail to resolve.

 giscanner/transformer.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 4cb167c..f78407a 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -726,8 +726,9 @@ Note that type resolution may not succeed."""
             return self._namespace.type_from_name(typestr)
         typeval = self.create_type_from_ctype_string(typestr)
         self.resolve_type(typeval)
-        # Explicitly clear out the c_type; there isn't one in this case.
-        typeval.ctype = None
+        if typeval.resolved:
+            # Explicitly clear out the c_type; there isn't one in this case.
+            typeval.ctype = None
         return typeval
 
     def _resolve_type_from_ctype(self, typeval):



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