mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Fix PyUnicode_GetSize(): Don't replace _PyUnicode_Ready() exception
This commit is contained in:
parent
8a8b3eaabe
commit
07621338fb
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue