summaryrefslogtreecommitdiff
path: root/giscanner/girwriter.py
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2009-12-22 11:10:33 -0500
committerColin Walters <walters@verbum.org>2010-02-12 16:12:27 -0500
commit965ff4c6583fd1bab80858ecde419bfc20ad540b (patch)
tree630423ecf568dc3b09f468cc36f0743d37bae9d1 /giscanner/girwriter.py
parentefc88ed30e212cc0cca9fbb57b245e4a02a3d136 (diff)
downloadgobject-introspection-965ff4c6583fd1bab80858ecde419bfc20ad540b.tar.gz
Fix glib:error-quark scanning for unregistered enum types
The enumeration type for an error might not be introspected and registered with GObject (this is, in particular, true for the errors in GLib itself). So, as a fallback search, through all enum types in the module. Add a special case for the aberrant GIOErrorEnum and a warning if resolution completely fails. https://bugzilla.gnome.org/show_bug.cgi?id=602512
Diffstat (limited to 'giscanner/girwriter.py')
-rw-r--r--giscanner/girwriter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py
index 78e34c9c..8088628d 100644
--- a/giscanner/girwriter.py
+++ b/giscanner/girwriter.py
@@ -278,10 +278,10 @@ and/or use gtk-doc annotations. ''')
attrs.extend([('glib:type-name', enum.type_name),
('glib:get-type', enum.get_type),
('c:type', enum.ctype)])
- if enum.error_quark:
- attrs.append(('glib:error-quark', enum.error_quark))
else:
attrs.append(('c:type', enum.symbol))
+ if hasattr(enum, 'error_quark') and enum.error_quark:
+ attrs.append(('glib:error-quark', enum.error_quark))
with self.tagcontext('enumeration', attrs):
self._write_attributes(enum)