Skip to content

Commit cbb9ba8

Browse files
authored
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).
1 parent 1469393 commit cbb9ba8

35 files changed

+37
-321
lines changed

Lib/test/clinic.test

+2-8
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,6 @@ test_unicode_converter(PyObject *module, PyObject *arg)
354354
_PyArg_BadArgument("test_unicode_converter", "argument", "str", arg);
355355
goto exit;
356356
}
357-
if (PyUnicode_READY(arg) == -1) {
358-
goto exit;
359-
}
360357
a = arg;
361358
return_value = test_unicode_converter_impl(module, a);
362359

@@ -366,7 +363,7 @@ exit:
366363

367364
static PyObject *
368365
test_unicode_converter_impl(PyObject *module, PyObject *a)
369-
/*[clinic end generated code: output=18f1e3880c862611 input=aa33612df92aa9c5]*/
366+
/*[clinic end generated code: output=8c1625cc272c1f3d input=aa33612df92aa9c5]*/
370367

371368

372369
/*[clinic input]
@@ -972,9 +969,6 @@ test_int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
972969
_PyArg_BadArgument("test_int_converter", "argument 3", "a unicode character", args[2]);
973970
goto exit;
974971
}
975-
if (PyUnicode_READY(args[2])) {
976-
goto exit;
977-
}
978972
if (PyUnicode_GET_LENGTH(args[2]) != 1) {
979973
_PyArg_BadArgument("test_int_converter", "argument 3", "a unicode character", args[2]);
980974
goto exit;
@@ -996,7 +990,7 @@ exit:
996990

997991
static PyObject *
998992
test_int_converter_impl(PyObject *module, int a, int b, int c, myenum d)
999-
/*[clinic end generated code: output=800993036e078c07 input=d20541fc1ca0553e]*/
993+
/*[clinic end generated code: output=375eedba5ca9a5b3 input=d20541fc1ca0553e]*/
1000994

1001995

1002996
/*[clinic input]

Modules/_io/clinic/_iomodule.c.h

+1-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_io/clinic/textio.c.h

+1-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_multiprocessing/clinic/posixshmem.c.h

+1-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_sqlite/clinic/connection.c.h

+1-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_sqlite/clinic/cursor.c.h

+1-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_sqlite/clinic/module.c.h

+1-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/clinic/_codecsmodule.c.h

+1-52
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/clinic/_localemodule.c.h

+1-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/clinic/_testclinic.c.h

+1-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)