mirror of
https://github.com/python/cpython.git
synced 2025-07-15 15:25:29 +00:00
Remove buggy assertion in PyUnicode_Substring()
Use also directly unicode_empty, instead of PyUnicode_New(0,0).
This commit is contained in:
parent
684d5fd420
commit
3a7f7977f1
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue