From 259f0e4437ed30036578aba822560feb531b7735 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 17 Jan 2017 01:35:17 +0100 Subject: Run Argument Clinic: METH_VARARGS=>METH_FASTCALL Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using only positional arguments. --- Modules/clinic/_gdbmmodule.c.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Modules/clinic/_gdbmmodule.c.h') diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h index fdd589c07a4..77d258bf657 100644 --- a/Modules/clinic/_gdbmmodule.c.h +++ b/Modules/clinic/_gdbmmodule.c.h @@ -231,26 +231,30 @@ PyDoc_STRVAR(dbmopen__doc__, "when the database has to be created. It defaults to octal 0o666."); #define DBMOPEN_METHODDEF \ - {"open", (PyCFunction)dbmopen, METH_VARARGS, dbmopen__doc__}, + {"open", (PyCFunction)dbmopen, METH_FASTCALL, dbmopen__doc__}, static PyObject * dbmopen_impl(PyObject *module, const char *name, const char *flags, int mode); static PyObject * -dbmopen(PyObject *module, PyObject *args) +dbmopen(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; const char *name; const char *flags = "r"; int mode = 438; - if (!PyArg_ParseTuple(args, "s|si:open", + if (!_PyArg_ParseStack(args, nargs, "s|si:open", &name, &flags, &mode)) { goto exit; } + + if (!_PyArg_NoStackKeywords("open", kwnames)) { + goto exit; + } return_value = dbmopen_impl(module, name, flags, mode); exit: return return_value; } -/*[clinic end generated code: output=ed0f5d4e3d79b80c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1e47d62a35eeba8b input=a9049054013a1b77]*/ -- cgit v1.2.3-65-gdbad