Commit 5eda913c authored by Benjamin Peterson's avatar Benjamin Peterson

PyUnicode_DecodeUTF8 will always return a ready string

parent 8f56e090
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment