[3.8] bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593). (GH-15599)
(cherry picked from commit 4901fe274bc82b95dc89bcb3de8802a3dfedab32)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h
index abed6cc..49608cc 100644
--- a/Python/clinic/bltinmodule.c.h
+++ b/Python/clinic/bltinmodule.c.h
@@ -102,7 +102,7 @@
goto skip_optional;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("format", 2, "str", args[1]);
+ _PyArg_BadArgument("format", "argument 2", "str", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1]) == -1) {
@@ -200,7 +200,7 @@
goto exit;
}
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("compile", 3, "str", args[2]);
+ _PyArg_BadArgument("compile", "argument 'mode'", "str", args[2]);
goto exit;
}
Py_ssize_t mode_length;
@@ -849,4 +849,4 @@
exit:
return return_value;
}
-/*[clinic end generated code: output=e173df340a9e4516 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1927f3c9abd00c35 input=a9049054013a1b77]*/