summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2014-04-16 17:15:05 -0400
committerRyan Lortie <desrt@desrt.ca>2014-05-06 08:15:23 -0400
commitf2858cff69da8bcd4cbe196ed3a2f20b93872ad4 (patch)
tree39f920425d23959ac4a6eb81afc199f0990c71d3
parent0839e696e9fbc1942ac5c61054de3b47e9578152 (diff)
downloadgobject-introspection-f2858cff69da8bcd4cbe196ed3a2f20b93872ad4.tar.gz
maintransformer: split up a complex conditional
We assign node.allow_none in two separate cases: - if the (allow-none) annotation was given - for GCancellable and GAsyncReadyCallback, as special cases Split the two up. This will simplify future commits. https://bugzilla.gnome.org/show_bug.cgi?id=660879
-rw-r--r--giscanner/maintransformer.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index afab7bc5..d957a1f0 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -579,9 +579,11 @@ class MainTransformer(object):
self._adjust_container_type(parent, node, annotations)
- if (ANN_ALLOW_NONE in annotations
- or node.type.target_giname == 'Gio.AsyncReadyCallback'
- or node.type.target_giname == 'Gio.Cancellable'):
+ if ANN_ALLOW_NONE in annotations:
+ node.allow_none = True
+
+ if (node.type.target_giname == 'Gio.AsyncReadyCallback' or
+ node.type.target_giname == 'Gio.Cancellable'):
node.allow_none = True
if tag and tag.description: