comparison Python/Python-ast.c @ 46207:59d42e6d1885 legacy-trunk

Fix error message -- "expects either 0 or 0 arguments"
author Georg Brandl <georg@python.org>
date Sun, 30 Mar 2008 19:43:27 +0000
parents 29ea507fd998
children be18df634405
comparison
equal deleted inserted replaced
46206:07f75d5519b4 46207:59d42e6d1885
384 goto cleanup; 384 goto cleanup;
385 } 385 }
386 res = 0; /* if no error occurs, this stays 0 to the end */ 386 res = 0; /* if no error occurs, this stays 0 to the end */
387 if (PyTuple_GET_SIZE(args) > 0) { 387 if (PyTuple_GET_SIZE(args) > 0) {
388 if (numfields != PyTuple_GET_SIZE(args)) { 388 if (numfields != PyTuple_GET_SIZE(args)) {
389 PyErr_Format(PyExc_TypeError, "%.400s constructor takes either 0 or " 389 PyErr_Format(PyExc_TypeError, "%.400s constructor takes %s"
390 "%d positional argument%s", Py_TYPE(self)->tp_name, 390 "%" PY_FORMAT_SIZE_T "d positional argument%s",
391 Py_TYPE(self)->tp_name,
392 numfields == 0 ? "" : "either 0 or ",
391 numfields, numfields == 1 ? "" : "s"); 393 numfields, numfields == 1 ? "" : "s");
392 res = -1; 394 res = -1;
393 goto cleanup; 395 goto cleanup;
394 } 396 }
395 for (i = 0; i < PyTuple_GET_SIZE(args); i++) { 397 for (i = 0; i < PyTuple_GET_SIZE(args); i++) {