bpo-37695: Correct unget_wch error message. (GH-14986)

(cherry picked from commit c9345e382c)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
This commit is contained in:
Miss Islington (bot) 2019-07-31 13:25:45 -07:00 committed by GitHub
parent 33b700ba8c
commit 35d9c37e27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1 @@
Correct :func:`curses.unget_wch` error message. Patch by Anthony Sottile.

View File

@ -3120,7 +3120,7 @@ PyCurses_ConvertToWchar_t(PyObject *obj,
wchar_t buffer[2];
if (PyUnicode_AsWideChar(obj, buffer, 2) != 1) {
PyErr_Format(PyExc_TypeError,
"expect bytes or str of length 1, or int, "
"expect str of length 1 or int, "
"got a str of length %zi",
PyUnicode_GET_LENGTH(obj));
return 0;
@ -3147,7 +3147,7 @@ PyCurses_ConvertToWchar_t(PyObject *obj,
}
else {
PyErr_Format(PyExc_TypeError,
"expect bytes or str of length 1, or int, got %s",
"expect str of length 1 or int, got %s",
Py_TYPE(obj)->tp_name);
return 0;
}