bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593)
diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h
index 84774f0..5ddbbe2 100644
--- a/Modules/cjkcodecs/clinic/multibytecodec.c.h
+++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h
@@ -55,7 +55,7 @@
}
}
else {
- _PyArg_BadArgument("encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("encode", "argument 'errors'", "str or None", args[1]);
goto exit;
}
skip_optional_pos:
@@ -103,7 +103,7 @@
goto exit;
}
if (!PyBuffer_IsContiguous(&input, 'C')) {
- _PyArg_BadArgument("decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
@@ -124,7 +124,7 @@
}
}
else {
- _PyArg_BadArgument("decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("decode", "argument 'errors'", "str or None", args[1]);
goto exit;
}
skip_optional_pos:
@@ -223,7 +223,7 @@
PyLongObject *statelong;
if (!PyLong_Check(arg)) {
- _PyArg_BadArgument("setstate", 0, "int", arg);
+ _PyArg_BadArgument("setstate", "argument", "int", arg);
goto exit;
}
statelong = (PyLongObject *)arg;
@@ -282,7 +282,7 @@
goto exit;
}
if (!PyBuffer_IsContiguous(&input, 'C')) {
- _PyArg_BadArgument("decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
@@ -345,7 +345,7 @@
PyObject *state;
if (!PyTuple_Check(arg)) {
- _PyArg_BadArgument("setstate", 0, "tuple", arg);
+ _PyArg_BadArgument("setstate", "argument", "tuple", arg);
goto exit;
}
state = arg;
@@ -525,4 +525,4 @@
#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
{"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
-/*[clinic end generated code: output=eb95a408c4ddbfff input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5ce6fd4ca1f95620 input=a9049054013a1b77]*/