From b960b3457745453e117948d29736861c1a7a6edd Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 20 Nov 2011 19:12:52 +0100 Subject: [PATCH] PyUnicode_AsUTF32String() calls directly _PyUnicode_EncodeUTF32(), instead of calling the deprecated PyUnicode_EncodeUTF32() function --- Objects/unicodeobject.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 9c1705d0dd..7aa5ff0e1a 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5150,12 +5150,7 @@ PyUnicode_EncodeUTF32(const Py_UNICODE *s, PyObject * PyUnicode_AsUTF32String(PyObject *unicode) { - const Py_UNICODE *wstr; - Py_ssize_t wlen; - wstr = PyUnicode_AsUnicodeAndSize(unicode, &wlen); - if (wstr == NULL) - return NULL; - return PyUnicode_EncodeUTF32(wstr, wlen, NULL, 0); + return _PyUnicode_EncodeUTF32(unicode, NULL, 0); } /* --- UTF-16 Codec ------------------------------------------------------- */ -- 2.40.0