mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59: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
|
@ -2610,10 +2610,6 @@ resolve_name(PyThreadState *tstate, PyObject *name, PyObject *globals, int level
|
|||
if (!haspath) {
|
||||
Py_ssize_t dot;
|
||||
|
||||
if (PyUnicode_READY(package) < 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
dot = PyUnicode_FindChar(package, '.',
|
||||
0, PyUnicode_GET_LENGTH(package), -1);
|
||||
if (dot == -2) {
|
||||
|
@ -2762,9 +2758,6 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals,
|
|||
"module name must be a string");
|
||||
goto error;
|
||||
}
|
||||
if (PyUnicode_READY(name) < 0) {
|
||||
goto error;
|
||||
}
|
||||
if (level < 0) {
|
||||
_PyErr_SetString(tstate, PyExc_ValueError, "level must be >= 0");
|
||||
goto error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue