summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-01 23:31:58 (GMT)
committerGitHub <noreply@github.com>2023-06-01 23:31:58 (GMT)
commitcbb9ba844f15f2b8127028e6dfd4681b2cb2376f (patch)
treee80117a8aa3fd5a6e2d13a3295a9d908c6cc5fa5 /PC
parent146939306adcff706ebddb047f7470d148125cdf (diff)
downloadcpython-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 'PC')
-rw-r--r--PC/clinic/_wmimodule.cpp.h5
-rw-r--r--PC/clinic/msvcrtmodule.c.h8
-rw-r--r--PC/clinic/winreg.c.h5
3 files changed, 3 insertions, 15 deletions
diff --git a/PC/clinic/_wmimodule.cpp.h b/PC/clinic/_wmimodule.cpp.h
index e2b947f..bfcad41 100644
--- a/PC/clinic/_wmimodule.cpp.h
+++ b/PC/clinic/_wmimodule.cpp.h
@@ -63,13 +63,10 @@ _wmi_exec_query(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj
_PyArg_BadArgument("exec_query", "argument 'query'", "str", args[0]);
goto exit;
}
- if (PyUnicode_READY(args[0]) == -1) {
- goto exit;
- }
query = args[0];
return_value = _wmi_exec_query_impl(module, query);
exit:
return return_value;
}
-/*[clinic end generated code: output=7fdf0c0579ddb566 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=923d09bee1d15c5f input=a9049054013a1b77]*/
diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h
index b708c6c..94e1730 100644
--- a/PC/clinic/msvcrtmodule.c.h
+++ b/PC/clinic/msvcrtmodule.c.h
@@ -399,9 +399,6 @@ msvcrt_putwch(PyObject *module, PyObject *arg)
_PyArg_BadArgument("putwch", "argument", "a unicode character", arg);
goto exit;
}
- if (PyUnicode_READY(arg)) {
- goto exit;
- }
if (PyUnicode_GET_LENGTH(arg) != 1) {
_PyArg_BadArgument("putwch", "argument", "a unicode character", arg);
goto exit;
@@ -477,9 +474,6 @@ msvcrt_ungetwch(PyObject *module, PyObject *arg)
_PyArg_BadArgument("ungetwch", "argument", "a unicode character", arg);
goto exit;
}
- if (PyUnicode_READY(arg)) {
- goto exit;
- }
if (PyUnicode_GET_LENGTH(arg) != 1) {
_PyArg_BadArgument("ungetwch", "argument", "a unicode character", arg);
goto exit;
@@ -707,4 +701,4 @@ exit:
#ifndef MSVCRT_GETERRORMODE_METHODDEF
#define MSVCRT_GETERRORMODE_METHODDEF
#endif /* !defined(MSVCRT_GETERRORMODE_METHODDEF) */
-/*[clinic end generated code: output=2db6197608a6aab3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=9dd12bf210e362a4 input=a9049054013a1b77]*/
diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h
index 2907788..2aa0698 100644
--- a/PC/clinic/winreg.c.h
+++ b/PC/clinic/winreg.c.h
@@ -1458,9 +1458,6 @@ winreg_SetValue(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
_PyArg_BadArgument("SetValue", "argument 4", "str", args[3]);
goto exit;
}
- if (PyUnicode_READY(args[3]) == -1) {
- goto exit;
- }
value_obj = args[3];
return_value = winreg_SetValue_impl(module, key, sub_key, type, value_obj);
@@ -1791,4 +1788,4 @@ exit:
#ifndef WINREG_QUERYREFLECTIONKEY_METHODDEF
#define WINREG_QUERYREFLECTIONKEY_METHODDEF
#endif /* !defined(WINREG_QUERYREFLECTIONKEY_METHODDEF) */
-/*[clinic end generated code: output=bbfdbb8681102d5c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d2bf1f58ad07e5f8 input=a9049054013a1b77]*/