summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/Python.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Python.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 26197365ee..2795d987f7 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -409,7 +409,14 @@ sub PythonFunctionBody($$$)
}
}
$self->pidl("status = dcerpc_$fn->{NAME}(iface->pipe, mem_ctx, r);");
- $self->handle_ntstatus("status", "NULL", "mem_ctx");
+ $self->pidl("if (NT_STATUS_IS_ERR(status)) {");
+ $self->indent;
+ $self->pidl("PyErr_SetDCERPCStatus(iface->pipe, status);");
+ $self->pidl("talloc_free(mem_ctx);");
+ $self->pidl("return NULL;");
+ $self->deindent;
+ $self->pidl("}");
+ $self->pidl("");
$env = GenerateFunctionOutEnv($fn, "r->");
my $i = 0;