mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
gh-92536: Remove PyUnicode_READY() calls (#105210)
Since Python 3.12, PyUnicode_READY() does nothing and always returns 0.
This commit is contained in:
parent
cbb9ba844f
commit
ef300937c2
32 changed files with 5 additions and 186 deletions
|
@ -824,9 +824,6 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
|
|||
if (!PyUnicode_Check(arg))
|
||||
return converterr("a unicode character", arg, msgbuf, bufsize);
|
||||
|
||||
if (PyUnicode_READY(arg))
|
||||
RETURN_ERR_OCCURRED;
|
||||
|
||||
if (PyUnicode_GET_LENGTH(arg) != 1)
|
||||
return converterr("a unicode character", arg, msgbuf, bufsize);
|
||||
|
||||
|
@ -1144,8 +1141,6 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
|
|||
case 'U': { /* PyUnicode object */
|
||||
PyObject **p = va_arg(*p_va, PyObject **);
|
||||
if (PyUnicode_Check(arg)) {
|
||||
if (PyUnicode_READY(arg) == -1)
|
||||
RETURN_ERR_OCCURRED;
|
||||
*p = arg;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue