summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-04-19 18:13:00 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-04-19 18:13:00 (GMT)
commitdb46fea8b63582e76a29f9dd23882523a474b600 (patch)
tree52994de47cfdb2095d1936462bdc5d6120130372 /Python
parentbb72c479965c8a260c5350a4f55cac957f41c7b7 (diff)
parentd6e53dab8677fae3f6d00053b0102f8031751587 (diff)
downloadcpython-db46fea8b63582e76a29f9dd23882523a474b600.zip
cpython-db46fea8b63582e76a29f9dd23882523a474b600.tar.gz
cpython-db46fea8b63582e76a29f9dd23882523a474b600.tar.bz2
Fixed error message for the "u#" format code.
Diffstat (limited to 'Python')
-rw-r--r--Python/getargs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index f0f8e39..c365fc2 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -967,7 +967,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **);
if (*format == '#') {
- /* "s#" or "Z#" */
+ /* "u#" or "Z#" */
FETCH_SIZE;
if (c == 'Z' && arg == Py_None) {
@@ -982,10 +982,11 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
STORE_SIZE(len);
}
else
- return converterr("str or None", arg, msgbuf, bufsize);
+ return converterr(c == 'Z' ? "str or None" : "str",
+ arg, msgbuf, bufsize);
format++;
} else {
- /* "s" or "Z" */
+ /* "u" or "Z" */
if (c == 'Z' && arg == Py_None)
*p = NULL;
else if (PyUnicode_Check(arg)) {