diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-01-16 14:47:42 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-01-16 14:47:42 (GMT) |
commit | 5eda913cd23d3fcfae7eff4c26239c83e337b6a3 (patch) | |
tree | 63f9790529680bd44793d387e2bc738d659f8952 /Python/ast.c | |
parent | 8f56e0909f77bf7f563fcebbc7e2c5dd241d5c47 (diff) | |
download | cpython-5eda913cd23d3fcfae7eff4c26239c83e337b6a3.zip cpython-5eda913cd23d3fcfae7eff4c26239c83e337b6a3.tar.gz cpython-5eda913cd23d3fcfae7eff4c26239c83e337b6a3.tar.bz2 |
PyUnicode_DecodeUTF8 will always return a ready string
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/ast.c b/Python/ast.c index 3440308..df2c63d 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) { |