diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2012-05-03 03:36:40 +0200 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2012-05-03 03:36:40 +0200 |
| commit | 3a7f7977f1ad3e5afe79254eef5057c0288613db (patch) | |
| tree | 5aa7c8262e8d2a203f17551f0129a385291d03ad /Objects/unicodeobject.c | |
| parent | 684d5fd42067109f46e94ea3ddab72ebd4e130ee (diff) | |
| download | cpython-git-3a7f7977f1ad3e5afe79254eef5057c0288613db.tar.gz | |
Remove buggy assertion in PyUnicode_Substring()
Use also directly unicode_empty, instead of PyUnicode_New(0,0).
Diffstat (limited to 'Objects/unicodeobject.c')
| -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 09b57338a0..0e7493bb61 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; |
