]> granicus.if.org Git - python/commitdiff
Replace PyUnicode_FromUnicode(NULL, 0) by PyUnicode_New(0, 0)
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 1 Dec 2011 02:18:59 +0000 (03:18 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 1 Dec 2011 02:18:59 +0000 (03:18 +0100)
Create an empty string with the new Unicode API.

Modules/cjkcodecs/multibytecodec.c
Objects/stringlib/unicode_format.h

index ded9188f071f1061b3894b9ea538e5c8fc4375d6..abad2512a6a3932ef717e0eb8d07ffbafbea0cd4 100644 (file)
@@ -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;
index 7de54381a2309e9f8319704e634a8452db8681ed..f05847a8bd6bfb2faa9b27fa8b27d13c776b6081 100644 (file)
@@ -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);
 }