summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-09-13 14:44:21 -0400
committerColin Walters <walters@verbum.org>2010-09-13 14:45:31 -0400
commit3236f2c4bb6e58f64f48b10f2b826b86c30aad16 (patch)
treec8ac983c16643acb313d6a49a787688a4a3b3d96 /giscanner
parent93481495a9cbfbf593be80393980c881c867db10 (diff)
scanner: Bomb out more obviously if a namespace contains class name = namespace
If you pass --namespace=FooBar, and have a GObject named FooBar, we'd assert. Give the user an obvious error message.
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/gdumpparser.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py
index 7960e97..ea5794e 100644
--- a/giscanner/gdumpparser.py
+++ b/giscanner/gdumpparser.py
@@ -279,6 +279,12 @@ blob containing data gleaned from GObject's primitive introspection."""
get_type = xmlnode.attrib['get-type']
(ns, name) = self._transformer.split_csymbol(get_type)
assert ns is self._namespace
+ if name == 'get_type':
+ message.fatal("""The GObject name %r isn't compatibile
+with the configured identifier prefixes:
+ %r
+The class would have no name. Most likely you want to specify a
+different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.identifier_prefixes))
assert name.endswith('_get_type')
return (get_type, name[:-len('_get_type')])