diff options
author | Giovanni Campagna <gcampagna@src.gnome.org> | 2012-07-02 22:51:19 +0200 |
---|---|---|
committer | Giovanni Campagna <gcampagna@src.gnome.org> | 2012-07-02 23:16:52 +0200 |
commit | b87a149dfbc5ce416e86e8f4aa9b45fc8a8cc791 (patch) | |
tree | 115347f3bf14050c8303290a0cda0b3407c362b7 /giscanner | |
parent | ad29240abf5af3215c5ea31783da470e19af2fcf (diff) | |
download | gobject-introspection-b87a149dfbc5ce416e86e8f4aa9b45fc8a8cc791.tar.gz |
Maintransfomer: fix again paring error domains with unregistered enums
Previous fix was wrong, as it called to_underscores_noprefix on a
prefixed type name. The actual fix is to call the transformer to
do the prefix / type_name split, and turn the latter to underscores.
Test case included.
https://bugzilla.gnome.org/show_bug.cgi?id=634202
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/maintransformer.py | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index 850d2424..87238755 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -900,19 +900,9 @@ the ones that failed to resolve removed.""" for enum in self._namespace.itervalues(): if not isinstance(enum, ast.Enum): continue - type_name = enum.ctype - uscored = to_underscores(type_name).lower() - + uscored = to_underscores_noprefix(enum.name).lower() uscore_enums[uscored] = enum - - try: - no_uscore_prefixed = self._transformer.strip_identifier(type_name) - except TransformerException, e: - message.warn(e) - no_uscore_prefixed = None - - if no_uscore_prefixed not in uscore_enums: - uscore_enums[no_uscore_prefixed] = enum + uscore_enums[enum.name] = enum for node in self._namespace.itervalues(): if not isinstance(node, ast.ErrorQuarkFunction): @@ -927,7 +917,7 @@ the ones that failed to resolve removed.""" else: enum = self._uscore_type_names.get(short) if enum is None: - enum = uscore_enums.get(full) + enum = uscore_enums.get(short) if enum is not None: enum.error_domain = node.error_domain else: |