From cd2a5a7bb85db1e823833dd6082da5aa9ad19d0b Mon Sep 17 00:00:00 2001 From: Garrett Regier Date: Mon, 6 Jul 2015 11:45:33 -0700 Subject: scanner: Fix allow-none on return values The optional annotation was being applied which is invalid for return values. https://bugzilla.gnome.org/show_bug.cgi?id=752029 Signed-off-by: Garrett Regier --- giscanner/maintransformer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'giscanner/maintransformer.py') diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index 8954fa70..da904cfd 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -653,7 +653,8 @@ class MainTransformer(object): node.optional = True if ANN_ALLOW_NONE in annotations: - if node.direction == ast.PARAM_DIRECTION_OUT: + if (node.direction == ast.PARAM_DIRECTION_OUT and + not isinstance(node, ast.Return)): node.optional = True else: node.nullable = True -- cgit v1.2.1