summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-07-05 21:07:41 +0200
committerGitHub <noreply@github.com>2020-07-05 21:07:41 +0200
commit7d2366cf83886540e895b89edc2c5d9997853c14 (patch)
tree9674b2d0362a683f462a58a2de55f47971db5b97
parent195aeadc284b9388fef7d855bc08b22d5526d239 (diff)
downloadcython-7d2366cf83886540e895b89edc2c5d9997853c14.tar.gz
Avoid calling PyUnicode_FromUnicode() in Py3 (GH-3721)
See https://github.com/cython/cython/pull/3677
-rw-r--r--Cython/Utility/StringTools.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Cython/Utility/StringTools.c b/Cython/Utility/StringTools.c
index b6862d9d0..1f27c4c59 100644
--- a/Cython/Utility/StringTools.c
+++ b/Cython/Utility/StringTools.c
@@ -561,7 +561,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring(
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);