mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-132987: Support __index__() for "k" and "K" formats in PyArg_Parse (GH-132988)
This commit is contained in:
parent
e714ead7a2
commit
632524a5cb
12 changed files with 51 additions and 30 deletions
6
Modules/clinic/_cursesmodule.c.h
generated
6
Modules/clinic/_cursesmodule.c.h
generated
|
@ -2388,7 +2388,7 @@ _curses_ungetmouse(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
|||
if (z == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyLong_Check(args[4])) {
|
||||
if (!PyIndex_Check(args[4])) {
|
||||
_PyArg_BadArgument("ungetmouse", "argument 5", "int", args[4]);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -3154,7 +3154,7 @@ _curses_mousemask(PyObject *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
unsigned long newmask;
|
||||
|
||||
if (!PyLong_Check(arg)) {
|
||||
if (!PyIndex_Check(arg)) {
|
||||
_PyArg_BadArgument("mousemask", "argument", "int", arg);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -4394,4 +4394,4 @@ _curses_has_extended_color_support(PyObject *module, PyObject *Py_UNUSED(ignored
|
|||
#ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF
|
||||
#define _CURSES_USE_DEFAULT_COLORS_METHODDEF
|
||||
#endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */
|
||||
/*[clinic end generated code: output=acae2eb9cf75e76d input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=dbbbe86a4171799a input=a9049054013a1b77]*/
|
||||
|
|
6
Modules/clinic/_testclinic.c.h
generated
6
Modules/clinic/_testclinic.c.h
generated
|
@ -1038,7 +1038,7 @@ unsigned_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t narg
|
|||
if (nargs < 3) {
|
||||
goto skip_optional;
|
||||
}
|
||||
if (!PyLong_Check(args[2])) {
|
||||
if (!PyIndex_Check(args[2])) {
|
||||
_PyArg_BadArgument("unsigned_long_converter", "argument 3", "int", args[2]);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1122,7 +1122,7 @@ unsigned_long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t
|
|||
if (nargs < 3) {
|
||||
goto skip_optional;
|
||||
}
|
||||
if (!PyLong_Check(args[2])) {
|
||||
if (!PyIndex_Check(args[2])) {
|
||||
_PyArg_BadArgument("unsigned_long_long_converter", "argument 3", "int", args[2]);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -4481,4 +4481,4 @@ _testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyO
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=b57b94aeba0882b4 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=84ffc31f27215baa input=a9049054013a1b77]*/
|
||||
|
|
4
Modules/clinic/fcntlmodule.c.h
generated
4
Modules/clinic/fcntlmodule.c.h
generated
|
@ -120,7 +120,7 @@ fcntl_ioctl(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
|||
if (fd < 0) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyLong_Check(args[1])) {
|
||||
if (!PyIndex_Check(args[1])) {
|
||||
PyErr_Format(PyExc_TypeError, "ioctl() argument 2 must be int, not %T", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -264,4 +264,4 @@ skip_optional:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=30c01b46bfa840c1 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=65a16bc64c7b4de4 input=a9049054013a1b77]*/
|
||||
|
|
6
Modules/clinic/posixmodule.c.h
generated
6
Modules/clinic/posixmodule.c.h
generated
|
@ -840,7 +840,7 @@ os_chflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *
|
|||
if (!path_converter(args[0], &path)) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyLong_Check(args[1])) {
|
||||
if (!PyIndex_Check(args[1])) {
|
||||
_PyArg_BadArgument("chflags", "argument 'flags'", "int", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -924,7 +924,7 @@ os_lchflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
|
|||
if (!path_converter(args[0], &path)) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyLong_Check(args[1])) {
|
||||
if (!PyIndex_Check(args[1])) {
|
||||
_PyArg_BadArgument("lchflags", "argument 'flags'", "int", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -13398,4 +13398,4 @@ os__emscripten_debugger(PyObject *module, PyObject *Py_UNUSED(ignored))
|
|||
#ifndef OS__EMSCRIPTEN_DEBUGGER_METHODDEF
|
||||
#define OS__EMSCRIPTEN_DEBUGGER_METHODDEF
|
||||
#endif /* !defined(OS__EMSCRIPTEN_DEBUGGER_METHODDEF) */
|
||||
/*[clinic end generated code: output=35dd8edb53b50537 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=a5ca2541f2af5462 input=a9049054013a1b77]*/
|
||||
|
|
4
Modules/clinic/signalmodule.c.h
generated
4
Modules/clinic/signalmodule.c.h
generated
|
@ -656,7 +656,7 @@ signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
|||
if (!_PyArg_CheckPositional("pthread_kill", nargs, 2, 2)) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyLong_Check(args[0])) {
|
||||
if (!PyIndex_Check(args[0])) {
|
||||
_PyArg_BadArgument("pthread_kill", "argument 1", "int", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -779,4 +779,4 @@ exit:
|
|||
#ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
|
||||
#define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
|
||||
#endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */
|
||||
/*[clinic end generated code: output=a8b1ac2fc44a007e input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=48bfaffeb25df5d2 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue