diff options
author | Georg Brandl <georg@python.org> | 2008-03-30 19:43:27 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-03-30 19:43:27 +0000 |
commit | 4823e58c7a415565b5e2bf216741caa6841146ae (patch) | |
tree | e7382bd967bf16f55662ab80d063df1300db86aa /Parser | |
parent | fd8833f686a38db41c2a87806c37218352b76700 (diff) | |
download | cpython-4823e58c7a415565b5e2bf216741caa6841146ae.tar.gz |
Fix error message -- "expects either 0 or 0 arguments"
Diffstat (limited to 'Parser')
-rwxr-xr-x | Parser/asdl_c.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 08592bc4c4..29e2547595 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -595,8 +595,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; |