[Python-checkins] cpython (merge 3.5 -> 3.6): Issue #28526: Use PyUnicode_AsEncodedString() instead of
serhiy.storchaka
python-checkins at python.org
Thu Oct 27 12:33:48 EDT 2016
https://hg.python.org/cpython/rev/fe9f361f3751
changeset: 104744:fe9f361f3751
branch: 3.6
parent: 104741:8c2615decd2e
parent: 104743:bea48e72cae5
user: Serhiy Storchaka <storchaka at gmail.com>
date: Thu Oct 27 19:33:05 2016 +0300
summary:
Issue #28526: Use PyUnicode_AsEncodedString() instead of
PyUnicode_AsEncodedObject() in _curese to ensure that the result
is a bytes object.
files:
Modules/_cursesmodule.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -230,7 +230,7 @@
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 @@
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;
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list