Commit 07621338 authored by Victor Stinner's avatar Victor Stinner

Fix PyUnicode_GetSize(): Don't replace _PyUnicode_Ready() exception

parent 8a8b3eaa
......@@ -3995,11 +3995,12 @@ PyUnicode_GetSize(PyObject *unicode)
Py_ssize_t
PyUnicode_GetLength(PyObject *unicode)
{
if (!PyUnicode_Check(unicode) || PyUnicode_READY(unicode) == -1) {
if (!PyUnicode_Check(unicode)) {
PyErr_BadArgument();
return -1;
}
if (PyUnicode_READY(unicode) == -1)
return -1;
return PyUnicode_GET_LENGTH(unicode);
}
......
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