[scanner] "GError *" is not the same as "GError **"
authorDan Winship <danw@gnome.org>
Wed, 9 Dec 2009 21:37:18 +0000 (16:37 -0500)
committerDan Winship <danw@gnome.org>
Wed, 9 Dec 2009 22:04:19 +0000 (17:04 -0500)
Only set "throws" in the latter case

https://bugzilla.gnome.org/show_bug.cgi?id=602512

giscanner/glibtransformer.py

index 158f8e8..d44987b 100644 (file)
@@ -960,9 +960,9 @@ class GLibTransformer(object):
 
         last_param = func.parameters.pop()
 
-        if (last_param.type.name == 'GLib.Error' or
-            (self._namespace_name == 'GLib' and
-             last_param.type.name == 'Error')):
+        # Checking type.name=='GLib.Error' generates false positives
+        # on methods that take a 'GError *'
+        if last_param.type.ctype == 'GError**':
             func.throws = True
         else:
             func.parameters.append(last_param)