From: Serhiy Storchaka Date: Sun, 19 Apr 2015 18:11:30 +0000 (+0300) Subject: Fixed error message for the "u#" format code. X-Git-Tag: v3.5.0a4~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6e53dab8677fae3f6d00053b0102f8031751587;p=thirdparty%2FPython%2Fcpython.git Fixed error message for the "u#" format code. --- diff --git a/Python/getargs.c b/Python/getargs.c index 3f47b21da5e1..6902d134892b 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -968,7 +968,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) { @@ -983,10 +983,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)) {