SF bug #692959: new.function ignores keyword arguments

This commit is contained in:
Raymond Hettinger 2003-05-06 09:01:41 +00:00
parent 411e5a2c29
commit 8657845e02

View file

@ -316,8 +316,11 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw)
PyObject *closure = Py_None;
PyFunctionObject *newfunc;
int nfree, nclosure;
static char *kwlist[] = {"code", "globals", "name",
"argdefs", "closure", 0};
if (!PyArg_ParseTuple(args, "O!O!|OOO:function",
if (!PyArg_ParseTupleAndKeywords(args, kw, "O!O!|OOO:function",
kwlist,
&PyCode_Type, &code,
&PyDict_Type, &globals,
&name, &defaults, &closure))