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

@ -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]*/