From: Victor Stinner Date: Thu, 1 Dec 2011 02:18:59 +0000 (+0100) Subject: Replace PyUnicode_FromUnicode(NULL, 0) by PyUnicode_New(0, 0) X-Git-Tag: v3.3.0a1~702 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b37b17423b294ee3bf5a28b8c358ca45cf681030;p=python Replace PyUnicode_FromUnicode(NULL, 0) by PyUnicode_New(0, 0) Create an empty string with the new Unicode API. --- diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index ded9188f07..abad2512a6 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -633,7 +633,7 @@ MultibyteCodec_Decode(MultibyteCodecObject *self, if (datalen == 0) { PyBuffer_Release(&pdata); ERROR_DECREF(errorcb); - return make_tuple(PyUnicode_FromUnicode(NULL, 0), 0); + return make_tuple(PyUnicode_New(0, 0), 0); } buf.excobj = NULL; @@ -1265,7 +1265,7 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self, Py_ssize_t rsize, finalsize = 0; if (sizehint == 0) - return PyUnicode_FromUnicode(NULL, 0); + return PyUnicode_New(0, 0); buf.outobj = buf.excobj = NULL; cres = NULL; diff --git a/Objects/stringlib/unicode_format.h b/Objects/stringlib/unicode_format.h index 7de54381a2..f05847a8bd 100644 --- a/Objects/stringlib/unicode_format.h +++ b/Objects/stringlib/unicode_format.h @@ -79,7 +79,7 @@ Py_LOCAL_INLINE(PyObject *) SubString_new_object_or_empty(SubString *str) { if (str->str == NULL) { - return PyUnicode_FromUnicode(NULL, 0); + return PyUnicode_New(0, 0); } return SubString_new_object(str); }