From: Stefan Metzmacher Date: Tue, 28 Jan 2025 09:07:18 +0000 (+0100) Subject: pidl:Python: introduce $is_raisable_return helper variable X-Git-Tag: samba-4.20.8~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4224ede9ea1229b975283659bc2ca24f02d89f9;p=thirdparty%2Fsamba.git pidl:Python: introduce $is_raisable_return helper variable No change in the generated code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14213 Signed-off-by: Stefan Metzmacher Reviewed-by: Douglas Bagnall (cherry picked from commit 8cdf7af43a365b0545562033f6c51150f2fbb3a4) --- diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 53dcf142de6..44c7e70507e 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -979,8 +979,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;