From d62eb3cc9f97b203d21ec6e75c48c739a43bc163 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 22 Feb 2017 10:08:46 +0100 Subject: [PATCH] pidl:Python: make sure print HASH references for STRUCT types BUG: https://bugzilla.samba.org/show_bug.cgi?id=12601 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- pidl/lib/Parse/Pidl/Samba4/Python.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 5edf96c5993..41b50e49737 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -245,12 +245,18 @@ sub PythonStruct($$$$$$) $self->pidl("static PyGetSetDef ".$getsetters."[] = {"); $self->indent; foreach my $e (@{$d->{ELEMENTS}}) { + my $etype = ""; + if (ref($e->{TYPE}) eq "HASH") { + $etype = $e->{TYPE}->{NAME}; + } else { + $etype = $e->{TYPE}; + } $self->pidl("{"); $self->indent; $self->pidl(".name = discard_const_p(char, \"$e->{NAME}\"),"); $self->pidl(".get = py_$name\_get_$e->{NAME},"); $self->pidl(".set = py_$name\_set_$e->{NAME},"); - $self->pidl(".doc = discard_const_p(char, \"PIDL-generated element of base type $e->{TYPE}\")"); + $self->pidl(".doc = discard_const_p(char, \"PIDL-generated element of base type $etype\")"); $self->deindent; $self->pidl("},"); } -- 2.34.1