]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-37695: Correct unget_wch error message. (GH-14986) 15066/head
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 31 Jul 2019 20:25:45 +0000 (13:25 -0700)
committerGitHub <noreply@github.com>
Wed, 31 Jul 2019 20:25:45 +0000 (13:25 -0700)
(cherry picked from commit c9345e382c630ddcc2b148b30954640e0e435c8a)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
Misc/NEWS.d/next/Library/2019-07-27-20-21-03.bpo-37695.QANdvg.rst [new file with mode: 0644]
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 (file)
index 0000000..ca6c116
--- /dev/null
@@ -0,0 +1 @@
+Correct :func:`curses.unget_wch` error message.  Patch by Anthony Sottile.
index 931c5ceed062f5b98b72d52acd96e778b35f3cc2..45decf96a352541ce065d6120632477fe7ee8fb2 100644 (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;
     }