mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
gh-92536: Argument Clinic no longer emits PyUnicode_READY() (#105208)
Since Python 3.12, PyUnicode_READY() does nothing and always returns 0. Argument Clinic now also checks for .cpp files (PC/_wmimodule.cpp).
This commit is contained in:
parent
146939306a
commit
cbb9ba844f
35 changed files with 37 additions and 321 deletions
23
Python/clinic/import.c.h
generated
23
Python/clinic/import.c.h
generated
|
|
@ -106,9 +106,6 @@ _imp__fix_co_filename(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
|||
_PyArg_BadArgument("_fix_co_filename", "argument 2", "str", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(args[1]) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
path = args[1];
|
||||
return_value = _imp__fix_co_filename_impl(module, code, path);
|
||||
|
||||
|
|
@ -165,9 +162,6 @@ _imp_init_frozen(PyObject *module, PyObject *arg)
|
|||
_PyArg_BadArgument("init_frozen", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
name = arg;
|
||||
return_value = _imp_init_frozen_impl(module, name);
|
||||
|
||||
|
|
@ -237,9 +231,6 @@ _imp_find_frozen(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb
|
|||
_PyArg_BadArgument("find_frozen", "argument 1", "str", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(args[0]) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
name = args[0];
|
||||
if (!noptargs) {
|
||||
goto skip_optional_kwonly;
|
||||
|
|
@ -282,9 +273,6 @@ _imp_get_frozen_object(PyObject *module, PyObject *const *args, Py_ssize_t nargs
|
|||
_PyArg_BadArgument("get_frozen_object", "argument 1", "str", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(args[0]) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
name = args[0];
|
||||
if (nargs < 2) {
|
||||
goto skip_optional;
|
||||
|
|
@ -319,9 +307,6 @@ _imp_is_frozen_package(PyObject *module, PyObject *arg)
|
|||
_PyArg_BadArgument("is_frozen_package", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
name = arg;
|
||||
return_value = _imp_is_frozen_package_impl(module, name);
|
||||
|
||||
|
|
@ -351,9 +336,6 @@ _imp_is_builtin(PyObject *module, PyObject *arg)
|
|||
_PyArg_BadArgument("is_builtin", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
name = arg;
|
||||
return_value = _imp_is_builtin_impl(module, name);
|
||||
|
||||
|
|
@ -383,9 +365,6 @@ _imp_is_frozen(PyObject *module, PyObject *arg)
|
|||
_PyArg_BadArgument("is_frozen", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
name = arg;
|
||||
return_value = _imp_is_frozen_impl(module, name);
|
||||
|
||||
|
|
@ -648,4 +627,4 @@ exit:
|
|||
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#define _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
|
||||
/*[clinic end generated code: output=b18d46e0036eff49 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=a95ec234672280a2 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue