aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-09-24 22:01:11 -0700
committerGuy Harris <guy@alum.mit.edu>2017-09-25 05:02:04 +0000
commit75f78cd49ad0ec63073764926407135732f677ce (patch)
tree52371363480a47a4e2500400245a5d78b7a5f022
parent5bda9bd4cb07c8b754202ce5950f9917db293222 (diff)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12601
Pick up change from Samba: commit d62eb3cc9f97b203d21ec6e75c48c739a43bc163 Author: Stefan Metzmacher <metze@samba.org> 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 <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Change-Id: Ieef766844ce66160eaaacecc73a51f94f69319fb Reviewed-on: https://code.wireshark.org/review/23717 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--tools/pidl/lib/Parse/Pidl/Samba4/Python.pm8
1 files changed, 7 insertions, 1 deletions
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("},");
}