mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +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
|
|
@ -823,9 +823,6 @@ _operator__compare_digest_impl(PyObject *module, PyObject *a, PyObject *b)
|
|||
|
||||
/* ASCII unicode string */
|
||||
if(PyUnicode_Check(a) && PyUnicode_Check(b)) {
|
||||
if (PyUnicode_READY(a) == -1 || PyUnicode_READY(b) == -1) {
|
||||
return NULL;
|
||||
}
|
||||
if (!PyUnicode_IS_ASCII(a) || !PyUnicode_IS_ASCII(b)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"comparing strings with non-ASCII characters is "
|
||||
|
|
@ -1234,10 +1231,6 @@ attrgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
Py_DECREF(attr);
|
||||
return NULL;
|
||||
}
|
||||
if (PyUnicode_READY(item)) {
|
||||
Py_DECREF(attr);
|
||||
return NULL;
|
||||
}
|
||||
Py_ssize_t item_len = PyUnicode_GET_LENGTH(item);
|
||||
int kind = PyUnicode_KIND(item);
|
||||
const void *data = PyUnicode_DATA(item);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue