[Python-checkins] cpython: PyUnicode_FromKindAndData() raises a ValueError if the kind is unknown

victor.stinner python-checkins at python.org
Sun Oct 2 01:14:15 CEST 2011


http://hg.python.org/cpython/rev/9124a00df142
changeset:   72573:9124a00df142
parent:      72571:fa0b1e50270f
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Sat Oct 01 23:48:37 2011 +0200
summary:
  PyUnicode_FromKindAndData() raises a ValueError if the kind is unknown

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


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1211,7 +1211,7 @@
     case PyUnicode_4BYTE_KIND:
         return _PyUnicode_FromUCS4(buffer, size);
     }
-    assert(0);
+    PyErr_SetString(PyExc_ValueError, "invalid kind");
     return NULL;
 }
 

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


More information about the Python-checkins mailing list