]> granicus.if.org Git - python/commitdiff
bpo-37695: Correct unget_wch error message. (GH-14986)
authorAnthony Sottile <asottile@umich.edu>
Wed, 31 Jul 2019 12:11:24 +0000 (05:11 -0700)
committerSerhiy Storchaka <storchaka@gmail.com>
Wed, 31 Jul 2019 12:11:24 +0000 (15:11 +0300)
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 8595b6282c1bdccd9c1898c236f3e7933a81551a..dbe3c99d7d59b95ae71920226e3b74c851ab37c6 100644 (file)
@@ -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;
     }