mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +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
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue