[Python-checkins] cpython: PyUnicode_AsUTF32String() calls directly _PyUnicode_EncodeUTF32(),

victor.stinner python-checkins at python.org
Sun Nov 20 22:53:25 CET 2011


http://hg.python.org/cpython/rev/459336931f19
changeset:   73639:459336931f19
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Sun Nov 20 19:12:52 2011 +0100
summary:
  PyUnicode_AsUTF32String() calls directly _PyUnicode_EncodeUTF32(),
instead of calling the deprecated PyUnicode_EncodeUTF32() function

files:
  Objects/unicodeobject.c |  7 +------
  1 files changed, 1 insertions(+), 6 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -5150,12 +5150,7 @@
 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 ------------------------------------------------------- */

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list