summaryrefslogtreecommitdiff
path: root/giscanner/maintransformer.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2019-01-13 14:00:28 +0100
committerGuido Günther <agx@sigxcpu.org>2019-01-13 14:08:18 +0100
commit361aa17c5302d5d9501b71ec352b39452dea6d23 (patch)
tree89d7d164d0be0169ab2297b5ea8d8abefb500827 /giscanner/maintransformer.py
parent329b71b7400b8bcf387a8c5551356ab9d76584b8 (diff)
downloadgobject-introspection-361aa17c5302d5d9501b71ec352b39452dea6d23.tar.gz
maintransformer: Don't warn on (optional) annotations on (inout)
This makes the scanner consistent with the docs.
Diffstat (limited to 'giscanner/maintransformer.py')
-rw-r--r--giscanner/maintransformer.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 23cbb942..e1536b93 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -657,11 +657,12 @@ class MainTransformer(object):
if ANN_OPTIONAL in annotations:
if (not isinstance(node, ast.Return) and
- node.direction == ast.PARAM_DIRECTION_OUT):
+ node.direction in [ast.PARAM_DIRECTION_OUT,
+ ast.PARAM_DIRECTION_INOUT]):
node.optional = True
else:
message.warn('invalid "optional" annotation: '
- 'only valid for out parameters',
+ 'only valid for out and inout parameters',
annotations.position)
if ANN_ALLOW_NONE in annotations: