Commit 3a7f7977 authored by Victor Stinner's avatar Victor Stinner

Remove buggy assertion in PyUnicode_Substring()

Use also directly unicode_empty, instead of PyUnicode_New(0,0).
parent 684d5fd4
...@@ -12078,8 +12078,8 @@ PyUnicode_Substring(PyObject *self, Py_ssize_t start, Py_ssize_t end) ...@@ -12078,8 +12078,8 @@ PyUnicode_Substring(PyObject *self, Py_ssize_t start, Py_ssize_t end)
return NULL; return NULL;
} }
if (start >= length || end < start) { if (start >= length || end < start) {
assert(end == length); Py_INCREF(unicode_empty);
return PyUnicode_New(0, 0); return unicode_empty;
} }
length = end - start; length = end - 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