diff options
author | Victor Stinner <vstinner@python.org> | 2023-06-01 23:31:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-01 23:31:58 (GMT) |
commit | cbb9ba844f15f2b8127028e6dfd4681b2cb2376f (patch) | |
tree | e80117a8aa3fd5a6e2d13a3295a9d908c6cc5fa5 /Python | |
parent | 146939306adcff706ebddb047f7470d148125cdf (diff) | |
download | cpython-cbb9ba844f15f2b8127028e6dfd4681b2cb2376f.zip cpython-cbb9ba844f15f2b8127028e6dfd4681b2cb2376f.tar.gz cpython-cbb9ba844f15f2b8127028e6dfd4681b2cb2376f.tar.bz2 |
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).
Diffstat (limited to 'Python')
-rw-r--r-- | Python/clinic/_warnings.c.h | 5 | ||||
-rw-r--r-- | Python/clinic/bltinmodule.c.h | 5 | ||||
-rw-r--r-- | Python/clinic/import.c.h | 23 | ||||
-rw-r--r-- | Python/clinic/sysmodule.c.h | 5 |
4 files changed, 4 insertions, 34 deletions
diff --git a/Python/clinic/_warnings.c.h b/Python/clinic/_warnings.c.h index 432e554..c716639 100644 --- a/Python/clinic/_warnings.c.h +++ b/Python/clinic/_warnings.c.h @@ -193,9 +193,6 @@ warnings_warn_explicit(PyObject *module, PyObject *const *args, Py_ssize_t nargs _PyArg_BadArgument("warn_explicit", "argument 'filename'", "str", args[2]); goto exit; } - if (PyUnicode_READY(args[2]) == -1) { - goto exit; - } filename = args[2]; lineno = _PyLong_AsInt(args[3]); if (lineno == -1 && PyErr_Occurred()) { @@ -246,4 +243,4 @@ warnings_filters_mutated(PyObject *module, PyObject *Py_UNUSED(ignored)) { return warnings_filters_mutated_impl(module); } -/*[clinic end generated code: output=20429719d7223bdc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f8d67e0f75771c36 input=a9049054013a1b77]*/ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index b77b4a1..b0d05dd 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -216,9 +216,6 @@ builtin_format(PyObject *module, PyObject *const *args, Py_ssize_t nargs) _PyArg_BadArgument("format", "argument 2", "str", args[1]); goto exit; } - if (PyUnicode_READY(args[1]) == -1) { - goto exit; - } format_spec = args[1]; skip_optional: return_value = builtin_format_impl(module, value, format_spec); @@ -1409,4 +1406,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=84a04e7446debf58 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ef2f16ece134d62d input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index cb74be6..dec9ea9 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -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]*/ diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index 7a7c188..a95a32f 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -282,9 +282,6 @@ sys_intern(PyObject *module, PyObject *arg) _PyArg_BadArgument("intern", "argument", "str", arg); goto exit; } - if (PyUnicode_READY(arg) == -1) { - goto exit; - } s = arg; return_value = sys_intern_impl(module, s); @@ -1415,4 +1412,4 @@ exit: #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF #define SYS_GETANDROIDAPILEVEL_METHODDEF #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=6d598acc26237fbe input=a9049054013a1b77]*/ +/*[clinic end generated code: output=41937e0843c68009 input=a9049054013a1b77]*/ |