summaryrefslogtreecommitdiff
path: root/PC
diff options
context:
space:
mode:
authorRĂ©mi Lapeyre <remi.lapeyre@henki.fr>2019-08-29 16:49:08 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2019-08-29 17:49:08 +0300
commit4901fe274bc82b95dc89bcb3de8802a3dfedab32 (patch)
tree2e6e4d0b1cdcb499df7f049ebc9dbbdb9f392bbe /PC
parent59725f3badb3028636c8906ecac4ceb0a37f3982 (diff)
downloadcpython-git-4901fe274bc82b95dc89bcb3de8802a3dfedab32.tar.gz
bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593)
Diffstat (limited to 'PC')
-rw-r--r--PC/clinic/_testconsole.c.h4
-rw-r--r--PC/clinic/msvcrtmodule.c.h14
2 files changed, 9 insertions, 9 deletions
diff --git a/PC/clinic/_testconsole.c.h b/PC/clinic/_testconsole.c.h
index a37d1235a0..cf5e4ee090 100644
--- a/PC/clinic/_testconsole.c.h
+++ b/PC/clinic/_testconsole.c.h
@@ -33,7 +33,7 @@ _testconsole_write_input(PyObject *module, PyObject *const *args, Py_ssize_t nar
}
file = args[0];
if (!PyBytes_Check(args[1])) {
- _PyArg_BadArgument("write_input", 2, "bytes", args[1]);
+ _PyArg_BadArgument("write_input", "argument 's'", "bytes", args[1]);
goto exit;
}
s = (PyBytesObject *)args[1];
@@ -88,4 +88,4 @@ exit:
#ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF
#define _TESTCONSOLE_READ_OUTPUT_METHODDEF
#endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */
-/*[clinic end generated code: output=ef452d5fb9287fc2 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=dd8b093a91b62753 input=a9049054013a1b77]*/
diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h
index d8e77d5f32..180c3e5fc5 100644
--- a/PC/clinic/msvcrtmodule.c.h
+++ b/PC/clinic/msvcrtmodule.c.h
@@ -375,7 +375,7 @@ msvcrt_putch(PyObject *module, PyObject *arg)
char_value = PyByteArray_AS_STRING(arg)[0];
}
else {
- _PyArg_BadArgument("putch", 0, "a byte string of length 1", arg);
+ _PyArg_BadArgument("putch", "argument", "a byte string of length 1", arg);
goto exit;
}
return_value = msvcrt_putch_impl(module, char_value);
@@ -403,14 +403,14 @@ msvcrt_putwch(PyObject *module, PyObject *arg)
int unicode_char;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("putwch", 0, "a unicode character", arg);
+ _PyArg_BadArgument("putwch", "argument", "a unicode character", arg);
goto exit;
}
if (PyUnicode_READY(arg)) {
goto exit;
}
if (PyUnicode_GET_LENGTH(arg) != 1) {
- _PyArg_BadArgument("putwch", 0, "a unicode character", arg);
+ _PyArg_BadArgument("putwch", "argument", "a unicode character", arg);
goto exit;
}
unicode_char = PyUnicode_READ_CHAR(arg, 0);
@@ -449,7 +449,7 @@ msvcrt_ungetch(PyObject *module, PyObject *arg)
char_value = PyByteArray_AS_STRING(arg)[0];
}
else {
- _PyArg_BadArgument("ungetch", 0, "a byte string of length 1", arg);
+ _PyArg_BadArgument("ungetch", "argument", "a byte string of length 1", arg);
goto exit;
}
return_value = msvcrt_ungetch_impl(module, char_value);
@@ -477,14 +477,14 @@ msvcrt_ungetwch(PyObject *module, PyObject *arg)
int unicode_char;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("ungetwch", 0, "a unicode character", arg);
+ _PyArg_BadArgument("ungetwch", "argument", "a unicode character", arg);
goto exit;
}
if (PyUnicode_READY(arg)) {
goto exit;
}
if (PyUnicode_GET_LENGTH(arg) != 1) {
- _PyArg_BadArgument("ungetwch", 0, "a unicode character", arg);
+ _PyArg_BadArgument("ungetwch", "argument", "a unicode character", arg);
goto exit;
}
unicode_char = PyUnicode_READ_CHAR(arg, 0);
@@ -679,4 +679,4 @@ exit:
#ifndef MSVCRT_SET_ERROR_MODE_METHODDEF
#define MSVCRT_SET_ERROR_MODE_METHODDEF
#endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */
-/*[clinic end generated code: output=816bc4f993893cea input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7cc6ffaf64f268f7 input=a9049054013a1b77]*/