Commit 7d2366cf authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

Avoid calling PyUnicode_FromUnicode() in Py3 (GH-3721)

See https://github.com/cython/cython/pull/3677
parent 195aeadc
...@@ -561,7 +561,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring( ...@@ -561,7 +561,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring(
else if (stop > length) else if (stop > length)
stop = length; stop = length;
if (stop <= start) if (stop <= start)
return PyUnicode_FromUnicode(NULL, 0); return __Pyx_NewRef($empty_unicode);
#if CYTHON_PEP393_ENABLED #if CYTHON_PEP393_ENABLED
return PyUnicode_FromKindAndData(PyUnicode_KIND(text), return PyUnicode_FromKindAndData(PyUnicode_KIND(text),
PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start); PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start);
......
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