diff options
author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2018-04-02 00:00:00 +0000 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2018-06-23 11:32:47 +0200 |
commit | 2e1913227118d043cd076ffb2c0ed1c21cfccd7f (patch) | |
tree | 41ff8b5ce9b02615f803e6d3765549feda36f616 /giscanner/transformer.py | |
parent | da426f7672b9c88658685aaf5cef948e02eb8c01 (diff) | |
download | gobject-introspection-2e1913227118d043cd076ffb2c0ed1c21cfccd7f.tar.gz |
Convert _Bool to gboolean for backward compatibility.
See !24 for the discussion
Diffstat (limited to 'giscanner/transformer.py')
-rw-r--r-- | giscanner/transformer.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py index b7d1facc..f5a2f477 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -699,6 +699,15 @@ raise ValueError.""" canonical = self._canonicalize_ctype(ctype) base = canonical.replace('*', '') + # While gboolean and _Bool are distinct types, they used to be treated + # by scanner as exactly the same one. In general this is incorrect + # because of different ABI, but this usually works fine, + # so for backward compatibility lets continue for now: + # https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/24#note_92792 + if canonical == '_Bool': + canonical = 'gboolean' + base = canonical + # Special default: char ** -> ast.Array, same for GStrv if (is_return and canonical == 'utf8*') or base == 'GStrv': bare_utf8 = ast.TYPE_STRING.clone() |