mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593)
This commit is contained in:
parent
59725f3bad
commit
4901fe274b
62 changed files with 623 additions and 553 deletions
30
Modules/clinic/_tkinter.c.h
generated
30
Modules/clinic/_tkinter.c.h
generated
|
|
@ -20,7 +20,7 @@ _tkinter_tkapp_eval(TkappObject *self, PyObject *arg)
|
|||
const char *script;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("eval", 0, "str", arg);
|
||||
_PyArg_BadArgument("eval", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t script_length;
|
||||
|
|
@ -56,7 +56,7 @@ _tkinter_tkapp_evalfile(TkappObject *self, PyObject *arg)
|
|||
const char *fileName;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("evalfile", 0, "str", arg);
|
||||
_PyArg_BadArgument("evalfile", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t fileName_length;
|
||||
|
|
@ -92,7 +92,7 @@ _tkinter_tkapp_record(TkappObject *self, PyObject *arg)
|
|||
const char *script;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("record", 0, "str", arg);
|
||||
_PyArg_BadArgument("record", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t script_length;
|
||||
|
|
@ -128,7 +128,7 @@ _tkinter_tkapp_adderrorinfo(TkappObject *self, PyObject *arg)
|
|||
const char *msg;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("adderrorinfo", 0, "str", arg);
|
||||
_PyArg_BadArgument("adderrorinfo", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t msg_length;
|
||||
|
|
@ -188,7 +188,7 @@ _tkinter_tkapp_exprstring(TkappObject *self, PyObject *arg)
|
|||
const char *s;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("exprstring", 0, "str", arg);
|
||||
_PyArg_BadArgument("exprstring", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t s_length;
|
||||
|
|
@ -224,7 +224,7 @@ _tkinter_tkapp_exprlong(TkappObject *self, PyObject *arg)
|
|||
const char *s;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("exprlong", 0, "str", arg);
|
||||
_PyArg_BadArgument("exprlong", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t s_length;
|
||||
|
|
@ -260,7 +260,7 @@ _tkinter_tkapp_exprdouble(TkappObject *self, PyObject *arg)
|
|||
const char *s;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("exprdouble", 0, "str", arg);
|
||||
_PyArg_BadArgument("exprdouble", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t s_length;
|
||||
|
|
@ -296,7 +296,7 @@ _tkinter_tkapp_exprboolean(TkappObject *self, PyObject *arg)
|
|||
const char *s;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("exprboolean", 0, "str", arg);
|
||||
_PyArg_BadArgument("exprboolean", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t s_length;
|
||||
|
|
@ -353,7 +353,7 @@ _tkinter_tkapp_createcommand(TkappObject *self, PyObject *const *args, Py_ssize_
|
|||
goto exit;
|
||||
}
|
||||
if (!PyUnicode_Check(args[0])) {
|
||||
_PyArg_BadArgument("createcommand", 1, "str", args[0]);
|
||||
_PyArg_BadArgument("createcommand", "argument 1", "str", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t name_length;
|
||||
|
|
@ -390,7 +390,7 @@ _tkinter_tkapp_deletecommand(TkappObject *self, PyObject *arg)
|
|||
const char *name;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("deletecommand", 0, "str", arg);
|
||||
_PyArg_BadArgument("deletecommand", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t name_length;
|
||||
|
|
@ -731,14 +731,14 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
|||
}
|
||||
}
|
||||
else {
|
||||
_PyArg_BadArgument("create", 1, "str or None", args[0]);
|
||||
_PyArg_BadArgument("create", "argument 1", "str or None", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
if (nargs < 2) {
|
||||
goto skip_optional;
|
||||
}
|
||||
if (!PyUnicode_Check(args[1])) {
|
||||
_PyArg_BadArgument("create", 2, "str", args[1]);
|
||||
_PyArg_BadArgument("create", "argument 2", "str", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t baseName_length;
|
||||
|
|
@ -754,7 +754,7 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
|||
goto skip_optional;
|
||||
}
|
||||
if (!PyUnicode_Check(args[2])) {
|
||||
_PyArg_BadArgument("create", 3, "str", args[2]);
|
||||
_PyArg_BadArgument("create", "argument 3", "str", args[2]);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t className_length;
|
||||
|
|
@ -832,7 +832,7 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
|||
}
|
||||
}
|
||||
else {
|
||||
_PyArg_BadArgument("create", 8, "str or None", args[7]);
|
||||
_PyArg_BadArgument("create", "argument 8", "str or None", args[7]);
|
||||
goto exit;
|
||||
}
|
||||
skip_optional:
|
||||
|
|
@ -912,4 +912,4 @@ exit:
|
|||
#ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
|
||||
#define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
|
||||
#endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */
|
||||
/*[clinic end generated code: output=2cf95f0101f3dbca input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=da0115c470aac1c0 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue