]> granicus.if.org Git - python/commitdiff
unicode_kind_name() doesn't check consistency anymore
authorVictor Stinner <vstinner@wyplay.com>
Mon, 3 Oct 2011 12:41:45 +0000 (14:41 +0200)
committerVictor Stinner <vstinner@wyplay.com>
Mon, 3 Oct 2011 12:41:45 +0000 (14:41 +0200)
It is is called from _PyUnicode_Dump() and so must not fail.

Objects/unicodeobject.c

index cc6b41697d5c6025bc5b781c009729d9c7d738b6..30db418832050b10bf596c1b1e82c29eb10eacd4 100644 (file)
@@ -627,7 +627,8 @@ _PyUnicode_New(Py_ssize_t length)
 static const char*
 unicode_kind_name(PyObject *unicode)
 {
-    assert(_PyUnicode_CHECK(unicode));
+    /* don't check consistency: unicode_kind_name() is called from
+       _PyUnicode_Dump() */
     if (!PyUnicode_IS_COMPACT(unicode))
     {
         if (!PyUnicode_IS_READY(unicode))