summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/pidl/lib/Parse/Pidl/Samba4/Python.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Samba4/Python.pm b/tools/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 566eaac395..07c18de3fb 100644
--- a/tools/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/tools/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -1218,6 +1218,14 @@ sub ConvertObjectFromPythonLevel($$$$$$$$)
$pl = GetPrevLevel($e, $pl);
}
+ $self->pidl("if ($py_var == NULL) {");
+ $self->indent;
+ $self->pidl("PyErr_Format(PyExc_AttributeError, \"Cannot delete NDR object: " .
+ mapTypeName($var_name) . "\");");
+ $self->pidl($fail);
+ $self->deindent;
+ $self->pidl("}");
+
if ($l->{TYPE} eq "POINTER") {
if ($l->{POINTER_TYPE} ne "ref") {
$self->pidl("if ($py_var == Py_None) {");