From: Stefan Metzmacher Date: Fri, 10 Mar 2017 16:41:46 +0000 (+0100) Subject: REVIEW: pidl/Python: make use of pyrpc_string_array_{from,to}_PyList() X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=cc21dc16f4d290621b4cc317769b33922b7892ef REVIEW: pidl/Python: make use of pyrpc_string_array_{from,to}_PyList() Signed-off-by: Stefan Metzmacher TODO: Reviewed-by: Arvid Requate --- diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 032ddf74984e..7f5fd20dbda8 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -1812,7 +1812,8 @@ sub ConvertObjectFromPythonData($$$$$$;$$) } if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "string_array") { - $self->pidl("$target = pytalloc_get_ptr($cvar);"); + $self->pidl("$target = pyrpc_string_array_from_PyList($mem_ctx, $cvar, \"$target\");"); + $self->fail_on_null($target, $fail); return; } @@ -2024,9 +2025,8 @@ sub ConvertScalarToPython($$$$) return "PyString_FromStringOrNULL($cvar)"; } - # Not yet supported if ($ctypename eq "string_array") { - return "pytalloc_GenericObject_reference_ex($mem_ctx, $cvar)"; + return "pyrpc_string_array_to_PyList($cvar, \"$cvar\")"; } if ($ctypename eq "ipv4address") { return "PyString_FromStringOrNULL($cvar)"; } if ($ctypename eq "ipv6address") { return "PyString_FromStringOrNULL($cvar)"; }