aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Objects/codeobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-02 01:33:17 +0200
committerGitHub <noreply@github.com>2023-06-02 01:33:17 +0200
commitef300937c2a1b3ebe19c2835f3b46585825c1e1f (patch)
tree34f151a390fb946ff985ed98e6c1bd096c4d090b /Objects/codeobject.c
parentcbb9ba844f15f2b8127028e6dfd4681b2cb2376f (diff)
downloadcpython-ef300937c2a1b3ebe19c2835f3b46585825c1e1f.tar.gz
cpython-ef300937c2a1b3ebe19c2835f3b46585825c1e1f.zip
gh-92536: Remove PyUnicode_READY() calls (#105210)
Since Python 3.12, PyUnicode_READY() does nothing and always returns 0.
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r--Objects/codeobject.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 9b54c610581..ebae0a3ec59 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -153,10 +153,6 @@ intern_string_constants(PyObject *tuple, int *modified)
for (Py_ssize_t i = PyTuple_GET_SIZE(tuple); --i >= 0; ) {
PyObject *v = PyTuple_GET_ITEM(tuple, i);
if (PyUnicode_CheckExact(v)) {
- if (PyUnicode_READY(v) == -1) {
- return -1;
- }
-
if (all_name_chars(v)) {
PyObject *w = v;
PyUnicode_InternInPlace(&v);
@@ -546,17 +542,6 @@ remove_column_info(PyObject *locations)
PyCodeObject *
_PyCode_New(struct _PyCodeConstructor *con)
{
- /* Ensure that strings are ready Unicode string */
- if (PyUnicode_READY(con->name) < 0) {
- return NULL;
- }
- if (PyUnicode_READY(con->qualname) < 0) {
- return NULL;
- }
- if (PyUnicode_READY(con->filename) < 0) {
- return NULL;
- }
-
if (intern_strings(con->names) < 0) {
return NULL;
}