From 7372e18fa83aa35766f8f6fdf3aed27fac2d52d2 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. --- Python/clinic/import.c.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Python/clinic/import.c.h') diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index b3460b061d..6ee91200c9 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -75,23 +75,27 @@ PyDoc_STRVAR(_imp__fix_co_filename__doc__, " File path to use."); #define _IMP__FIX_CO_FILENAME_METHODDEF \ - {"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_VARARGS, _imp__fix_co_filename__doc__}, + {"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_FASTCALL, _imp__fix_co_filename__doc__}, static PyObject * _imp__fix_co_filename_impl(PyObject *module, PyCodeObject *code, PyObject *path); static PyObject * -_imp__fix_co_filename(PyObject *module, PyObject *args) +_imp__fix_co_filename(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyCodeObject *code; PyObject *path; - if (!PyArg_ParseTuple(args, "O!U:_fix_co_filename", + if (!_PyArg_ParseStack(args, nargs, "O!U:_fix_co_filename", &PyCode_Type, &code, &path)) { goto exit; } + + if (!_PyArg_NoStackKeywords("_fix_co_filename", kwnames)) { + goto exit; + } return_value = _imp__fix_co_filename_impl(module, code, path); exit: @@ -361,4 +365,4 @@ exit: #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=d24d7f73702a907f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5a3f012344950548 input=a9049054013a1b77]*/ -- cgit v1.2.1 From 104cb4a3bacdf9764f9f8670a80da16390231337 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 17 Jan 2017 02:21:47 +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 "boring" positional arguments. Manually fix _elementtree: _elementtree_XMLParser_doctype() must remain consistent with the clinic code. --- Python/clinic/import.c.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Python/clinic/import.c.h') diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 6ee91200c9..0165b7c4e1 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -273,23 +273,27 @@ PyDoc_STRVAR(_imp_create_dynamic__doc__, "Create an extension module."); #define _IMP_CREATE_DYNAMIC_METHODDEF \ - {"create_dynamic", (PyCFunction)_imp_create_dynamic, METH_VARARGS, _imp_create_dynamic__doc__}, + {"create_dynamic", (PyCFunction)_imp_create_dynamic, METH_FASTCALL, _imp_create_dynamic__doc__}, static PyObject * _imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file); static PyObject * -_imp_create_dynamic(PyObject *module, PyObject *args) +_imp_create_dynamic(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *spec; PyObject *file = NULL; - if (!PyArg_UnpackTuple(args, "create_dynamic", + if (!_PyArg_UnpackStack(args, nargs, "create_dynamic", 1, 2, &spec, &file)) { goto exit; } + + if (!_PyArg_NoStackKeywords("create_dynamic", kwnames)) { + goto exit; + } return_value = _imp_create_dynamic_impl(module, spec, file); exit: @@ -365,4 +369,4 @@ exit: #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=5a3f012344950548 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c1d0e65d04114958 input=a9049054013a1b77]*/ -- cgit v1.2.1