[Python-checkins] bpo-37695: Correct unget_wch error message. (GH-14986)

Miss Islington (bot) webhook-mailer at python.org
Wed Jul 31 16:45:19 EDT 2019


https://github.com/python/cpython/commit/462f07040b39b778aa782d0f62050b70416dec7b
commit: 462f07040b39b778aa782d0f62050b70416dec7b
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-07-31T13:44:59-07:00
summary:

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

(cherry picked from commit c9345e382c630ddcc2b148b30954640e0e435c8a)

Co-authored-by: Anthony Sottile <asottile at umich.edu>

files:
A Misc/NEWS.d/next/Library/2019-07-27-20-21-03.bpo-37695.QANdvg.rst
M Modules/_cursesmodule.c

diff --git a/Misc/NEWS.d/next/Library/2019-07-27-20-21-03.bpo-37695.QANdvg.rst b/Misc/NEWS.d/next/Library/2019-07-27-20-21-03.bpo-37695.QANdvg.rst
new file mode 100644
index 000000000000..ca6c11641ed6
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-07-27-20-21-03.bpo-37695.QANdvg.rst
@@ -0,0 +1 @@
+Correct :func:`curses.unget_wch` error message.  Patch by Anthony Sottile.
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 2435e1c12955..8fca7fcf1c18 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -4176,7 +4176,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;
@@ -4203,7 +4203,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;
     }



More information about the Python-checkins mailing list