From 0727fbe87d0016a3b18dbdfedcd417126e1aa514 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 12 Dec 2008 19:01:40 +0100 Subject: Don't allow specifying arguments to pidl object constructors, as they'll be ignored anyway atm. --- pidl/lib/Parse/Pidl/Samba4/Python.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 2664275934..4c598b3ca0 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -224,7 +224,10 @@ sub PythonStruct($$$$$$) $self->pidl("static PyObject *py_$name\_new(PyTypeObject *self, PyObject *args, PyObject *kwargs)"); $self->pidl("{"); $self->indent; + $self->pidl("char *kwlist[] = {NULL};"); $self->pidl("$cname *ret = talloc_zero(NULL, $cname);"); + $self->pidl("if (!PyArg_ParseTupleAndKeywords(args, kwargs, \"\", kwlist))"); + $self->pidl("\treturn NULL;"); $self->pidl("return py_talloc_import(&$name\_Type, ret);"); $self->deindent; $self->pidl("}"); -- cgit