diff Python/ast.c @ 74443:f5214817ed57

PyUnicode_DecodeUTF8 will always return a ready string
author Benjamin Peterson <benjamin@python.org>
date Mon, 16 Jan 2012 09:47:42 -0500
parents 0debff8be37e
children fe40a87484cc
line wrap: on
line diff
--- a/Python/ast.c	Mon Jan 16 09:42:36 2012 -0500
+++ b/Python/ast.c	Mon Jan 16 09:47:42 2012 -0500
@@ -532,8 +532,9 @@
 {
     _Py_IDENTIFIER(normalize);
     PyObject* id = PyUnicode_DecodeUTF8(n, strlen(n), NULL);
-    if (!id || PyUnicode_READY(id) == -1)
+    if (!id)
         return NULL;
+    assert(PyUnicode_IS_READY(id));
     /* Check whether there are non-ASCII characters in the
        identifier; if so, normalize to NFKC. */
     if (PyUnicode_MAX_CHAR_VALUE((PyUnicodeObject *)id) >= 128) {