]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pidl:Python: introduce $is_raisable_return helper variable
authorStefan Metzmacher <metze@samba.org>
Tue, 28 Jan 2025 09:07:18 +0000 (10:07 +0100)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 29 Jan 2025 01:14:40 +0000 (01:14 +0000)
No change in the generated code.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14213

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
pidl/lib/Parse/Pidl/Samba4/Python.pm

index 667df4adc68e71da7430d5e37662b75a6d3b1109..4b0071404cdb28ec5ba62f70face00b4080d59b7 100644 (file)
@@ -1029,8 +1029,13 @@ sub PythonFunctionUnpackOut($$$)
                $result_size++;
        }
 
-       if ($fn->{RETURN_TYPE}) {
-               $result_size++ unless ($fn->{RETURN_TYPE} eq "WERROR" or $fn->{RETURN_TYPE} eq "NTSTATUS");
+       my $is_raisable_return = 0;
+       if ($fn->{RETURN_TYPE} and ($fn->{RETURN_TYPE} eq "WERROR" or $fn->{RETURN_TYPE} eq "NTSTATUS")) {
+               $is_raisable_return = 1;
+       }
+
+       if ($fn->{RETURN_TYPE} and not $is_raisable_return) {
+               $result_size++;
        }
 
        my $i = 0;