From 75f78cd49ad0ec63073764926407135732f677ce Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 24 Sep 2017 22:01:11 -0700 Subject: [PATCH] BUG: https://bugzilla.samba.org/show_bug.cgi?id=12601 Pick up change from Samba: commit d62eb3cc9f97b203d21ec6e75c48c739a43bc163 Author: Stefan Metzmacher Date: Wed Feb 22 10:08:46 2017 +0100 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 Change-Id: Ieef766844ce66160eaaacecc73a51f94f69319fb Reviewed-on: https://code.wireshark.org/review/23717 Reviewed-by: Guy Harris --- tools/pidl/lib/Parse/Pidl/Samba4/Python.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/pidl/lib/Parse/Pidl/Samba4/Python.pm b/tools/pidl/lib/Parse/Pidl/Samba4/Python.pm index 5edf96c599..41b50e4973 100644 --- a/tools/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/tools/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("},"); }