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:
Victor Stinner 2023-06-02 01:31:58 +02:00 committed by GitHub
parent 146939306a
commit cbb9ba844f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 37 additions and 321 deletions

View file

@ -966,9 +966,6 @@ pysqlite_connection_execute(pysqlite_Connection *self, PyObject *const *args, Py
_PyArg_BadArgument("execute", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
goto exit;
}
sql = args[0];
if (nargs < 2) {
goto skip_optional;
@ -1008,9 +1005,6 @@ pysqlite_connection_executemany(pysqlite_Connection *self, PyObject *const *args
_PyArg_BadArgument("executemany", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
goto exit;
}
sql = args[0];
parameters = args[1];
return_value = pysqlite_connection_executemany_impl(self, sql, parameters);
@ -1665,4 +1659,4 @@ exit:
#ifndef DESERIALIZE_METHODDEF
#define DESERIALIZE_METHODDEF
#endif /* !defined(DESERIALIZE_METHODDEF) */
/*[clinic end generated code: output=834a99827555bf1a input=a9049054013a1b77]*/
/*[clinic end generated code: output=d3c6cb9326736ea5 input=a9049054013a1b77]*/

View file

@ -65,9 +65,6 @@ pysqlite_cursor_execute(pysqlite_Cursor *self, PyObject *const *args, Py_ssize_t
_PyArg_BadArgument("execute", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
goto exit;
}
sql = args[0];
if (nargs < 2) {
goto skip_optional;
@ -107,9 +104,6 @@ pysqlite_cursor_executemany(pysqlite_Cursor *self, PyObject *const *args, Py_ssi
_PyArg_BadArgument("executemany", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
goto exit;
}
sql = args[0];
seq_of_parameters = args[1];
return_value = pysqlite_cursor_executemany_impl(self, sql, seq_of_parameters);
@ -319,4 +313,4 @@ pysqlite_cursor_close(pysqlite_Cursor *self, PyObject *Py_UNUSED(ignored))
{
return pysqlite_cursor_close_impl(self);
}
/*[clinic end generated code: output=1f82e3c9791bb9a5 input=a9049054013a1b77]*/
/*[clinic end generated code: output=831f7bc5256526d3 input=a9049054013a1b77]*/

View file

@ -133,9 +133,6 @@ pysqlite_register_converter(PyObject *module, PyObject *const *args, Py_ssize_t
_PyArg_BadArgument("register_converter", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
goto exit;
}
orig_name = args[0];
callable = args[1];
return_value = pysqlite_register_converter_impl(module, orig_name, callable);
@ -211,4 +208,4 @@ skip_optional:
exit:
return return_value;
}
/*[clinic end generated code: output=39d38c6cfc455042 input=a9049054013a1b77]*/
/*[clinic end generated code: output=e08e6856ae546e7b input=a9049054013a1b77]*/