summaryrefslogtreecommitdiffstats
path: root/Modules/arraymodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r--Modules/arraymodule.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 6430333..3c60350 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -1799,18 +1799,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;