summaryrefslogtreecommitdiffstats
path: root/Objects/object.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 /Objects/object.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 'Objects/object.c')
-rw-r--r--Objects/object.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/Objects/object.c b/Objects/object.c
index ece0c5e..824c4e4 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -560,11 +560,6 @@ PyObject_Repr(PyObject *v)
Py_DECREF(res);
return NULL;
}
-#ifndef Py_DEBUG
- if (PyUnicode_READY(res) < 0) {
- return NULL;
- }
-#endif
return res;
}
@@ -583,10 +578,6 @@ PyObject_Str(PyObject *v)
if (v == NULL)
return PyUnicode_FromString("<NULL>");
if (PyUnicode_CheckExact(v)) {
-#ifndef Py_DEBUG
- if (PyUnicode_READY(v) < 0)
- return NULL;
-#endif
return Py_NewRef(v);
}
if (Py_TYPE(v)->tp_str == NULL)
@@ -618,11 +609,6 @@ PyObject_Str(PyObject *v)
Py_DECREF(res);
return NULL;
}
-#ifndef Py_DEBUG
- if (PyUnicode_READY(res) < 0) {
- return NULL;
- }
-#endif
assert(_PyUnicode_CheckConsistency(res, 1));
return res;
}