[Python-checkins] cpython: Add assertion to _Py_ReleaseInternedUnicodeStrings() if READY fails

victor.stinner python-checkins at python.org
Tue Oct 4 20:52:53 CEST 2011


http://hg.python.org/cpython/rev/3e721c405093
changeset:   72676:3e721c405093
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Tue Oct 04 20:04:52 2011 +0200
summary:
  Add assertion to _Py_ReleaseInternedUnicodeStrings() if READY fails

files:
  Objects/unicodeobject.c |  6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -13131,7 +13131,7 @@
     if (PyUnicode_CHECK_INTERNED(s))
         return;
     if (_PyUnicode_READY_REPLACE(p)) {
-        assert(0 && "PyUnicode_READY fail in PyUnicode_InternInPlace");
+        assert(0 && "_PyUnicode_READY_REPLACE fail in PyUnicode_InternInPlace");
         return;
     }
     s = (PyUnicodeObject *)(*p);
@@ -13217,8 +13217,10 @@
             n);
     for (i = 0; i < n; i++) {
         s = (PyUnicodeObject *) PyList_GET_ITEM(keys, i);
-        if (PyUnicode_READY(s) == -1)
+        if (PyUnicode_READY(s) == -1) {
+            assert(0 && "could not ready string");
             fprintf(stderr, "could not ready string\n");
+        }
         switch (PyUnicode_CHECK_INTERNED(s)) {
         case SSTATE_NOT_INTERNED:
             /* XXX Shouldn't happen */

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list