From 08e6f9308fed377f2dcfcdf726e82066ca1fa8ea Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 20 Oct 2012 21:10:45 +0200 Subject: [PATCH] scanner: Deprecate using identifier prefixes in GINames Instead of crashing. For more details, see the attached bug. Based on a patch by Stef Walter . https://bugzilla.gnome.org/show_bug.cgi?id=684370 --- giscanner/transformer.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/giscanner/transformer.py b/giscanner/transformer.py index 6afad889..dfd25507 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -151,11 +151,15 @@ namespaces.""" if '.' not in name: return self._namespace.get(name) else: - (ns, name) = name.split('.', 1) + (ns, giname) = name.split('.', 1) if ns == self._namespace.name: - return self._namespace.get(name) + return self._namespace.get(giname) + if ns in self._namespace.identifier_prefixes: + message.warn(("Deprecated reference to identifier " + + "prefix %s in GIName %s") % (ns, name)) + return self._namespace.get(giname) include = self._includes[ns] - return include.get(name) + return include.get(giname) def lookup_typenode(self, typeobj): """Given a Type object, if it points to a giname, -- 2.34.1