diff options
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r-- | Modules/arraymodule.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 7ed3b73..0e78e65 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -1774,18 +1774,9 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds) char c; PyObject *initial = NULL, *it = NULL; struct arraydescr *descr; - - if (kwds != NULL) { - int i = PyObject_Length(kwds); - if (i < 0) - return NULL; - else if (i > 0) { - PyErr_SetString(PyExc_TypeError, - "array.array constructor takes " - "no keyword arguments"); - return NULL; - } - } + + if (!_PyArg_NoKeywords("array.array()", kwds)) + return NULL; if (!PyArg_ParseTuple(args, "c|O:array", &c, &initial)) return NULL; |