aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/import.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 /Python/import.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 'Python/import.c')
-rw-r--r--Python/import.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/Python/import.c b/Python/import.c
index 9e1857d5f3e..7f04b1aa609 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -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;