From 9087a67088a001536844e86c891f623eaf77c0e4 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 9 Sep 2010 16:04:08 +0200 Subject: [PATCH] Use Node.ctype instead of Node.c_name when looking up comment blocks We were missing some annotation blocks for structs in typelibs with a name different to the C prefix. --- giscanner/maintransformer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index 01bc7b41..4a9c9528 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -168,7 +168,10 @@ def _pass_read_annotations(self, node, chain): if isinstance(node, (ast.Class, ast.Interface, ast.Record, ast.Union, ast.Enum, ast.Bitfield, ast.Callback)): - block = self._blocks.get(node.c_name) + if node.ctype is not None: + block = self._blocks.get(node.ctype) + else: + block = self._blocks.get(node.c_name) self._apply_annotations_annotated(node, block) if isinstance(node, (ast.Class, ast.Interface, ast.Record, ast.Union)): for field in node.fields: