Don't allow specifying arguments to pidl object constructors, as they'll
authorJelmer Vernooij <jelmer@samba.org>
Fri, 12 Dec 2008 18:01:40 +0000 (19:01 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 12 Dec 2008 18:01:40 +0000 (19:01 +0100)
be ignored anyway atm.

pidl/lib/Parse/Pidl/Samba4/Python.pm

index 26642759349d6616665dc67d2df727df5d199e8a..4c598b3ca0da5f45bbcb414cd5e6f4bd0a35401a 100644 (file)
@@ -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("}");