From: Victor Stinner Date: Sun, 20 Nov 2011 18:12:52 +0000 (+0100) Subject: PyUnicode_AsUTF32String() calls directly _PyUnicode_EncodeUTF32(), X-Git-Tag: v3.3.0a1~793 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b960b3457745453e117948d29736861c1a7a6edd;p=thirdparty%2FPython%2Fcpython.git PyUnicode_AsUTF32String() calls directly _PyUnicode_EncodeUTF32(), instead of calling the deprecated PyUnicode_EncodeUTF32() function --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 9c1705d0dd9f..7aa5ff0e1a32 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 ------------------------------------------------------- */