[gobject-introspection] ast: Avoid a crash with anonymous structs



commit 1dabcc4c17f2eb98ed38eaf4c022d43f29965a61
Author: Scott D Phillips <scott d phillips intel com>
Date:   Wed May 4 17:39:26 2016 -0700

    ast: Avoid a crash with anonymous structs
    
    We enabled anonymous unions earlier, this is a bugfix to enable
    anonymous structs.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=766011

 giscanner/ast.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/giscanner/ast.py b/giscanner/ast.py
index 99bbd3e..7a2b5b1 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -569,7 +569,8 @@ class Node(Annotated):
 (namespace, name) pair.  When combined with a ., this is called a
 GIName.  It's possible for nodes to contain or point to other nodes."""
 
-    c_name = property(lambda self: self.namespace.name + self.name)
+    c_name = property(lambda self: self.namespace.name + self.name if self.namespace else
+                      self.name)
     gi_name = property(lambda self: '%s.%s' % (self.namespace.name, self.name))
 
     def __init__(self, name=None):


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