diff options
author | Victor Stinner <vstinner@python.org> | 2023-06-01 23:33:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-01 23:33:17 (GMT) |
commit | ef300937c2a1b3ebe19c2835f3b46585825c1e1f (patch) | |
tree | 34f151a390fb946ff985ed98e6c1bd096c4d090b /Modules/_operator.c | |
parent | cbb9ba844f15f2b8127028e6dfd4681b2cb2376f (diff) | |
download | cpython-ef300937c2a1b3ebe19c2835f3b46585825c1e1f.zip cpython-ef300937c2a1b3ebe19c2835f3b46585825c1e1f.tar.gz cpython-ef300937c2a1b3ebe19c2835f3b46585825c1e1f.tar.bz2 |
gh-92536: Remove PyUnicode_READY() calls (#105210)
Since Python 3.12, PyUnicode_READY() does nothing and always
returns 0.
Diffstat (limited to 'Modules/_operator.c')
-rw-r--r-- | Modules/_operator.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/Modules/_operator.c b/Modules/_operator.c index 68ccc90..153e9e9 100644 --- a/Modules/_operator.c +++ b/Modules/_operator.c @@ -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); |