diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-05-03 01:36:40 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-05-03 01:36:40 (GMT) |
commit | 3a7f7977f1ad3e5afe79254eef5057c0288613db (patch) | |
tree | 5aa7c8262e8d2a203f17551f0129a385291d03ad | |
parent | 684d5fd42067109f46e94ea3ddab72ebd4e130ee (diff) | |
download | cpython-3a7f7977f1ad3e5afe79254eef5057c0288613db.zip cpython-3a7f7977f1ad3e5afe79254eef5057c0288613db.tar.gz cpython-3a7f7977f1ad3e5afe79254eef5057c0288613db.tar.bz2 |
Remove buggy assertion in PyUnicode_Substring()
Use also directly unicode_empty, instead of PyUnicode_New(0,0).
-rw-r--r-- | Objects/unicodeobject.c | 4 |
1 files 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; |