From 3a7f7977f1ad3e5afe79254eef5057c0288613db Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 3 May 2012 03:36:40 +0200 Subject: Remove buggy assertion in PyUnicode_Substring() Use also directly unicode_empty, instead of PyUnicode_New(0,0). --- Objects/unicodeobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 09b5733..0e7493b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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; -- cgit v0.12