summaryrefslogtreecommitdiff
path: root/Python/Python-ast.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-03-30 19:43:27 +0000
committerGeorg Brandl <georg@python.org>2008-03-30 19:43:27 +0000
commit4823e58c7a415565b5e2bf216741caa6841146ae (patch)
treee7382bd967bf16f55662ab80d063df1300db86aa /Python/Python-ast.c
parentfd8833f686a38db41c2a87806c37218352b76700 (diff)
downloadcpython-4823e58c7a415565b5e2bf216741caa6841146ae.tar.gz
Fix error message -- "expects either 0 or 0 arguments"
Diffstat (limited to 'Python/Python-ast.c')
-rw-r--r--Python/Python-ast.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index d4734187de..ba310e6089 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -386,8 +386,10 @@ ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
res = 0; /* if no error occurs, this stays 0 to the end */
if (PyTuple_GET_SIZE(args) > 0) {
if (numfields != PyTuple_GET_SIZE(args)) {
- PyErr_Format(PyExc_TypeError, "%.400s constructor takes either 0 or "
- "%d positional argument%s", Py_TYPE(self)->tp_name,
+ PyErr_Format(PyExc_TypeError, "%.400s constructor takes %s"
+ "%" PY_FORMAT_SIZE_T "d positional argument%s",
+ Py_TYPE(self)->tp_name,
+ numfields == 0 ? "" : "either 0 or ",
numfields, numfields == 1 ? "" : "s");
res = -1;
goto cleanup;