Commit b37b1742 authored by Victor Stinner's avatar Victor Stinner

Replace PyUnicode_FromUnicode(NULL, 0) by PyUnicode_New(0, 0)

Create an empty string with the new Unicode API.
parent 08b523a1
...@@ -633,7 +633,7 @@ MultibyteCodec_Decode(MultibyteCodecObject *self, ...@@ -633,7 +633,7 @@ MultibyteCodec_Decode(MultibyteCodecObject *self,
if (datalen == 0) { if (datalen == 0) {
PyBuffer_Release(&pdata); PyBuffer_Release(&pdata);
ERROR_DECREF(errorcb); ERROR_DECREF(errorcb);
return make_tuple(PyUnicode_FromUnicode(NULL, 0), 0); return make_tuple(PyUnicode_New(0, 0), 0);
} }
buf.excobj = NULL; buf.excobj = NULL;
...@@ -1265,7 +1265,7 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self, ...@@ -1265,7 +1265,7 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self,
Py_ssize_t rsize, finalsize = 0; Py_ssize_t rsize, finalsize = 0;
if (sizehint == 0) if (sizehint == 0)
return PyUnicode_FromUnicode(NULL, 0); return PyUnicode_New(0, 0);
buf.outobj = buf.excobj = NULL; buf.outobj = buf.excobj = NULL;
cres = NULL; cres = NULL;
......
...@@ -79,7 +79,7 @@ Py_LOCAL_INLINE(PyObject *) ...@@ -79,7 +79,7 @@ Py_LOCAL_INLINE(PyObject *)
SubString_new_object_or_empty(SubString *str) SubString_new_object_or_empty(SubString *str)
{ {
if (str->str == NULL) { if (str->str == NULL) {
return PyUnicode_FromUnicode(NULL, 0); return PyUnicode_New(0, 0);
} }
return SubString_new_object(str); return SubString_new_object(str);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment