summaryrefslogtreecommitdiffstats
path: root/Modules/_operator.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-01 23:33:17 (GMT)
committerGitHub <noreply@github.com>2023-06-01 23:33:17 (GMT)
commitef300937c2a1b3ebe19c2835f3b46585825c1e1f (patch)
tree34f151a390fb946ff985ed98e6c1bd096c4d090b /Modules/_operator.c
parentcbb9ba844f15f2b8127028e6dfd4681b2cb2376f (diff)
downloadcpython-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.c7
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);