diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-27 16:33:05 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-27 16:33:05 (GMT) |
commit | 802426f99b93e8338c0c3fc6df0b97eb6b211a3e (patch) | |
tree | d32bcc19e95b475a65235979f89370dafa3e4246 /Modules | |
parent | b1152be2def8d4073cbb0ac3c05aed88d5e8360f (diff) | |
parent | b29cee40ee948731f239cc3a200c62ea3dbabc9f (diff) | |
download | cpython-802426f99b93e8338c0c3fc6df0b97eb6b211a3e.zip cpython-802426f99b93e8338c0c3fc6df0b97eb6b211a3e.tar.gz cpython-802426f99b93e8338c0c3fc6df0b97eb6b211a3e.tar.bz2 |
Issue #28526: Use PyUnicode_AsEncodedString() instead of
PyUnicode_AsEncodedObject() in _curese to ensure that the result
is a bytes object.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_cursesmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index a48735f..e63c16c 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -230,7 +230,7 @@ PyCurses_ConvertToChtype(PyCursesWindowObject *win, PyObject *obj, chtype *ch) encoding = win->encoding; else encoding = screen_encoding; - bytes = PyUnicode_AsEncodedObject(obj, encoding, NULL); + bytes = PyUnicode_AsEncodedString(obj, encoding, NULL); if (bytes == NULL) return 0; if (PyBytes_GET_SIZE(bytes) == 1) @@ -352,7 +352,7 @@ PyCurses_ConvertToString(PyCursesWindowObject *win, PyObject *obj, return 2; #else assert (wstr == NULL); - *bytes = PyUnicode_AsEncodedObject(obj, win->encoding, NULL); + *bytes = PyUnicode_AsEncodedString(obj, win->encoding, NULL); if (*bytes == NULL) return 0; return 1; |