mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
bpo-37695: Correct unget_wch error message. (GH-14986)
This commit is contained in:
parent
31c4fd2a10
commit
c9345e382c
2 changed files with 3 additions and 2 deletions
|
|
@ -0,0 +1 @@
|
||||||
|
Correct :func:`curses.unget_wch` error message. Patch by Anthony Sottile.
|
||||||
|
|
@ -4176,7 +4176,7 @@ PyCurses_ConvertToWchar_t(PyObject *obj,
|
||||||
wchar_t buffer[2];
|
wchar_t buffer[2];
|
||||||
if (PyUnicode_AsWideChar(obj, buffer, 2) != 1) {
|
if (PyUnicode_AsWideChar(obj, buffer, 2) != 1) {
|
||||||
PyErr_Format(PyExc_TypeError,
|
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",
|
"got a str of length %zi",
|
||||||
PyUnicode_GET_LENGTH(obj));
|
PyUnicode_GET_LENGTH(obj));
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -4203,7 +4203,7 @@ PyCurses_ConvertToWchar_t(PyObject *obj,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PyErr_Format(PyExc_TypeError,
|
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);
|
Py_TYPE(obj)->tp_name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue