From: Jelmer Vernooij Date: Fri, 12 Dec 2008 18:01:40 +0000 (+0100) Subject: Don't allow specifying arguments to pidl object constructors, as they'll X-Git-Tag: samba-4.0.0alpha6~479^2~6 X-Git-Url: http://git.samba.org/samba.git/?p=ab%2Fsamba.git%2F.git;a=commitdiff_plain;h=0727fbe87d0016a3b18dbdfedcd417126e1aa514 Don't allow specifying arguments to pidl object constructors, as they'll be ignored anyway atm. --- diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 26642759349..4c598b3ca0d 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("}");