summaryrefslogtreecommitdiff
path: root/pidl/lib/Parse/Pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-12-21 00:37:31 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-12-21 00:37:31 +0100
commitc1a9b68623a663c36451df31aa44fe5f0e22af17 (patch)
treec71fb34b1fa9c050e93d38d97e37280dc9ea4d0f /pidl/lib/Parse/Pidl
parent64419f47daa3d28587fd29f5c4217755acac7e4f (diff)
downloadsamba-c1a9b68623a663c36451df31aa44fe5f0e22af17.tar.gz
samba-c1a9b68623a663c36451df31aa44fe5f0e22af17.tar.bz2
samba-c1a9b68623a663c36451df31aa44fe5f0e22af17.zip
Create and use convenience function for creating new talloc-wrapping Python Objects, support subtypes of DCE/RPC interfaces properly
Diffstat (limited to 'pidl/lib/Parse/Pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 15dbd67b7c..120a35a1cf 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -224,8 +224,7 @@ sub PythonStruct($$$$$$)
$self->pidl("static PyObject *py_$name\_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)");
$self->pidl("{");
$self->indent;
- $self->pidl("$cname *ret = talloc_zero(NULL, $cname);");
- $self->pidl("return py_talloc_import(type, ret);");
+ $self->pidl("return py_talloc_new($cname, type);");
$self->deindent;
$self->pidl("}");
$self->pidl("");
@@ -677,7 +676,7 @@ sub Interface($$$)
$self->pidl("};");
$self->pidl("");
- $self->pidl("static PyObject *interface_$interface->{NAME}_new(PyTypeObject *self, PyObject *args, PyObject *kwargs)");
+ $self->pidl("static PyObject *interface_$interface->{NAME}_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)");
$self->pidl("{");
$self->indent;
$self->pidl("dcerpc_InterfaceObject *ret;");
@@ -728,7 +727,7 @@ sub Interface($$$)
$self->deindent;
$self->pidl("}");
- $self->pidl("ret = PyObject_New(dcerpc_InterfaceObject, &$interface->{NAME}_InterfaceType);");
+ $self->pidl("ret = PyObject_New(dcerpc_InterfaceObject, type);");
$self->pidl("");
$self->pidl("event_ctx = event_context_init(mem_ctx);");
$self->pidl("");