From 15ebda7e1b18cc29be891b1370473c8bc3acc2c6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 7 May 2008 17:26:40 +0200 Subject: Deal with interface in generated python code, clearer error message on unhandled unions. --- source4/pidl/lib/Parse/Pidl/Samba4/Python.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/Python.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm index ab67236717..b7d092015c 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -1025,6 +1025,9 @@ sub ConvertObjectToPythonData($$$$$) return $self->ConvertScalarToPython(Parse::Pidl::Typelist::bitmap_type_fn($actual_ctype), $cvar); } elsif ($actual_ctype->{TYPE} eq "SCALAR") { return $self->ConvertScalarToPython($actual_ctype->{NAME}, $cvar); + } elsif ($actual_ctype->{TYPE} eq "UNION") { + # FIXME: Should be fatal() rather than die() + die("union without discriminant: " . mapTypeName($ctype) . ": $cvar"); } elsif ($actual_ctype->{TYPE} eq "STRUCT" or $actual_ctype->{TYPE} eq "INTERFACE") { return "py_talloc_import_ex(&$ctype->{NAME}_Type, $mem_ctx, $cvar)"; } -- cgit