[Python-checkins] cpython: Remove buggy assertion in PyUnicode_Substring()

victor.stinner python-checkins at python.org
Thu May 3 03:37:48 CEST 2012


http://hg.python.org/cpython/rev/69ed936deb0f
changeset: 76724:69ed936deb0f
user: Victor Stinner <victor.stinner at gmail.com>
date: Thu May 03 03:36:40 2012 +0200
summary:
 Remove buggy assertion in PyUnicode_Substring()
Use also directly unicode_empty, instead of PyUnicode_New(0,0).
files:
 Objects/unicodeobject.c | 4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -12078,8 +12078,8 @@
 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;
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /