# HG changeset patch # User Victor Stinner <vstinner@python.org> # Date 1593976061 -7200 # Sun Jul 05 21:07:41 2020 +0200 # Node ID 02fd67565175b728c12b855299fb1200c0c55690 # Parent 381a79dcc7c34d92ad65b0b63cb6eb4381d3eb40 Avoid calling PyUnicode_FromUnicode() in Py3 (GH-3721) See https://github.com/cython/cython/pull/3677 diff --git a/Cython/Utility/StringTools.c b/Cython/Utility/StringTools.c --- a/Cython/Utility/StringTools.c +++ b/Cython/Utility/StringTools.c @@ -561,7 +561,7 @@ else if (stop > length) stop = length; if (stop <= start) - return PyUnicode_FromUnicode(NULL, 0); + return __Pyx_NewRef($empty_unicode); #if CYTHON_PEP393_ENABLED return PyUnicode_FromKindAndData(PyUnicode_KIND(text), PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start);