Remove buggy assertion in PyUnicode_Substring()

Use also directly unicode_empty, instead of PyUnicode_New(0,0).
This commit is contained in:
Victor Stinner 2012-05-03 03:36:40 +02:00
parent 684d5fd420
commit 3a7f7977f1
1 changed files with 2 additions and 2 deletions

View File

@ -12078,8 +12078,8 @@ PyUnicode_Substring(PyObject *self, Py_ssize_t start, Py_ssize_t end)
return NULL;
}
if (start >= length || end < start) {
assert(end == length);
return PyUnicode_New(0, 0);
Py_INCREF(unicode_empty);
return unicode_empty;
}
length = end - start;