From: Benjamin Peterson Date: Mon, 16 Jan 2012 14:47:42 +0000 (-0500) Subject: PyUnicode_DecodeUTF8 will always return a ready string X-Git-Tag: v3.3.0a1~385 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5eda913cd23d3fcfae7eff4c26239c83e337b6a3;p=thirdparty%2FPython%2Fcpython.git PyUnicode_DecodeUTF8 will always return a ready string --- diff --git a/Python/ast.c b/Python/ast.c index 3440308ea9d8..df2c63da1b68 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -532,8 +532,9 @@ new_identifier(const char* n, PyArena *arena) { _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) {