[3.8] bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593). (GH-15599)

(cherry picked from commit 4901fe274b)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
This commit is contained in:
Serhiy Storchaka 2019-08-29 18:29:59 +03:00 committed by GitHub
parent 9db66a2b5a
commit 96631dcb11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 623 additions and 553 deletions

View file

@ -100,7 +100,7 @@ stringlib_ljust(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
fillchar = PyByteArray_AS_STRING(args[1])[0];
}
else {
_PyArg_BadArgument("ljust", 2, "a byte string of length 1", args[1]);
_PyArg_BadArgument("ljust", "argument 2", "a byte string of length 1", args[1]);
goto exit;
}
skip_optional:
@ -161,7 +161,7 @@ stringlib_rjust(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
fillchar = PyByteArray_AS_STRING(args[1])[0];
}
else {
_PyArg_BadArgument("rjust", 2, "a byte string of length 1", args[1]);
_PyArg_BadArgument("rjust", "argument 2", "a byte string of length 1", args[1]);
goto exit;
}
skip_optional:
@ -222,7 +222,7 @@ stringlib_center(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
fillchar = PyByteArray_AS_STRING(args[1])[0];
}
else {
_PyArg_BadArgument("center", 2, "a byte string of length 1", args[1]);
_PyArg_BadArgument("center", "argument 2", "a byte string of length 1", args[1]);
goto exit;
}
skip_optional:
@ -274,4 +274,4 @@ stringlib_zfill(PyObject *self, PyObject *arg)
exit:
return return_value;
}
/*[clinic end generated code: output=96cbb19b238d0e84 input=a9049054013a1b77]*/
/*[clinic end generated code: output=15be047aef999b4e input=a9049054013a1b77]*/