summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-02-22 10:08:46 +0100
committerAndrew Bartlett <abartlet@samba.org>2017-02-25 02:39:11 +0100
commitd62eb3cc9f97b203d21ec6e75c48c739a43bc163 (patch)
tree0547748c8426754ef6c28a35af07258cf90f9f41 /pidl
parent8b2b721208dd0b05595d50851f0e13486e0b915f (diff)
downloadsamba-d62eb3cc9f97b203d21ec6e75c48c739a43bc163.tar.gz
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>
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm8
1 files changed, 7 insertions, 1 deletions
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("},");
}