mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +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
|
@ -200,10 +200,6 @@ write_str(stringio *self, PyObject *obj)
|
|||
return -1;
|
||||
|
||||
assert(PyUnicode_Check(decoded));
|
||||
if (PyUnicode_READY(decoded)) {
|
||||
Py_DECREF(decoded);
|
||||
return -1;
|
||||
}
|
||||
len = PyUnicode_GET_LENGTH(decoded);
|
||||
assert(len >= 0);
|
||||
|
||||
|
@ -542,8 +538,6 @@ _io_StringIO_write(stringio *self, PyObject *obj)
|
|||
Py_TYPE(obj)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
if (PyUnicode_READY(obj))
|
||||
return NULL;
|
||||
CHECK_CLOSED(self);
|
||||
size = PyUnicode_GET_LENGTH(obj);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue