From: Colin Walters Date: Sat, 20 Oct 2012 19:10:45 +0000 (+0200) Subject: scanner: Deprecate using identifier prefixes in GINames X-Git-Tag: GOBJECT_INTROSPECTION_1_35_2~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08e6f9308fed377f2dcfcdf726e82066ca1fa8ea;p=platform%2Fupstream%2Fgobject-introspection.git 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 --- 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,