From 756c4a7107e1a3ef7afc95fe3a55b04105cbb172 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 9 Jun 2016 16:01:19 +0300 Subject: Regenerate Argument Clinic code for issue #23026. --- PC/clinic/winreg.c.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'PC/clinic/winreg.c.h') diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index 338e33d39a..5176130014 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -907,7 +907,7 @@ PyDoc_STRVAR(winreg_SetValueEx__doc__, " An integer that specifies the type of the data, one of:\n" " REG_BINARY -- Binary data in any form.\n" " REG_DWORD -- A 32-bit number.\n" -" REG_DWORD_LITTLE_ENDIAN -- A 32-bit number in little-endian format.\n" +" REG_DWORD_LITTLE_ENDIAN -- A 32-bit number in little-endian format. Equivalent to REG_DWORD\n" " REG_DWORD_BIG_ENDIAN -- A 32-bit number in big-endian format.\n" " REG_EXPAND_SZ -- A null-terminated string that contains unexpanded\n" " references to environment variables (for example,\n" @@ -917,6 +917,8 @@ PyDoc_STRVAR(winreg_SetValueEx__doc__, " by two null characters. Note that Python handles\n" " this termination automatically.\n" " REG_NONE -- No defined value type.\n" +" REG_QWORD -- A 64-bit number.\n" +" REG_QWORD_LITTLE_ENDIAN -- A 64-bit number in little-endian format. Equivalent to REG_QWORD.\n" " REG_RESOURCE_LIST -- A device-driver resource list.\n" " REG_SZ -- A null-terminated string.\n" " value\n" @@ -1056,4 +1058,4 @@ winreg_QueryReflectionKey(PyModuleDef *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=5e346dccc296f9f1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0b71782e9b37b12a input=a9049054013a1b77]*/ -- cgit v1.2.1 From a397e56d2aad76fe5cacd54a2ecbdb03702985c7 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 9 Jun 2016 16:16:06 +0300 Subject: Issue #26305: Argument Clinic now uses braces in C code as required by PEP 7. --- PC/clinic/winreg.c.h | 86 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 57 insertions(+), 29 deletions(-) (limited to 'PC/clinic/winreg.c.h') diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index 5176130014..f3a4cd1f69 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -93,8 +93,9 @@ winreg_HKEYType___exit__(PyHKEYObject *self, PyObject *args, PyObject *kwargs) PyObject *traceback; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:__exit__", _keywords, - &exc_type, &exc_value, &traceback)) + &exc_type, &exc_value, &traceback)) { goto exit; + } return_value = winreg_HKEYType___exit___impl(self, exc_type, exc_value, traceback); exit: @@ -147,11 +148,13 @@ winreg_ConnectRegistry(PyModuleDef *module, PyObject *args) HKEY _return_value; if (!PyArg_ParseTuple(args, "ZO&:ConnectRegistry", - &computer_name, clinic_HKEY_converter, &key)) + &computer_name, clinic_HKEY_converter, &key)) { goto exit; + } _return_value = winreg_ConnectRegistry_impl(module, computer_name, key); - if (_return_value == NULL) + if (_return_value == NULL) { goto exit; + } return_value = PyHKEY_FromHKEY(_return_value); exit: @@ -192,11 +195,13 @@ winreg_CreateKey(PyModuleDef *module, PyObject *args) HKEY _return_value; if (!PyArg_ParseTuple(args, "O&Z:CreateKey", - clinic_HKEY_converter, &key, &sub_key)) + clinic_HKEY_converter, &key, &sub_key)) { goto exit; + } _return_value = winreg_CreateKey_impl(module, key, sub_key); - if (_return_value == NULL) + if (_return_value == NULL) { goto exit; + } return_value = PyHKEY_FromHKEY(_return_value); exit: @@ -247,11 +252,13 @@ winreg_CreateKeyEx(PyModuleDef *module, PyObject *args, PyObject *kwargs) HKEY _return_value; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:CreateKeyEx", _keywords, - clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) + clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; + } _return_value = winreg_CreateKeyEx_impl(module, key, sub_key, reserved, access); - if (_return_value == NULL) + if (_return_value == NULL) { goto exit; + } return_value = PyHKEY_FromHKEY(_return_value); exit: @@ -290,8 +297,9 @@ winreg_DeleteKey(PyModuleDef *module, PyObject *args) Py_UNICODE *sub_key; if (!PyArg_ParseTuple(args, "O&u:DeleteKey", - clinic_HKEY_converter, &key, &sub_key)) + clinic_HKEY_converter, &key, &sub_key)) { goto exit; + } return_value = winreg_DeleteKey_impl(module, key, sub_key); exit: @@ -341,8 +349,9 @@ winreg_DeleteKeyEx(PyModuleDef *module, PyObject *args, PyObject *kwargs) int reserved = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&u|ii:DeleteKeyEx", _keywords, - clinic_HKEY_converter, &key, &sub_key, &access, &reserved)) + clinic_HKEY_converter, &key, &sub_key, &access, &reserved)) { goto exit; + } return_value = winreg_DeleteKeyEx_impl(module, key, sub_key, access, reserved); exit: @@ -374,8 +383,9 @@ winreg_DeleteValue(PyModuleDef *module, PyObject *args) Py_UNICODE *value; if (!PyArg_ParseTuple(args, "O&Z:DeleteValue", - clinic_HKEY_converter, &key, &value)) + clinic_HKEY_converter, &key, &value)) { goto exit; + } return_value = winreg_DeleteValue_impl(module, key, value); exit: @@ -411,8 +421,9 @@ winreg_EnumKey(PyModuleDef *module, PyObject *args) int index; if (!PyArg_ParseTuple(args, "O&i:EnumKey", - clinic_HKEY_converter, &key, &index)) + clinic_HKEY_converter, &key, &index)) { goto exit; + } return_value = winreg_EnumKey_impl(module, key, index); exit: @@ -457,8 +468,9 @@ winreg_EnumValue(PyModuleDef *module, PyObject *args) int index; if (!PyArg_ParseTuple(args, "O&i:EnumValue", - clinic_HKEY_converter, &key, &index)) + clinic_HKEY_converter, &key, &index)) { goto exit; + } return_value = winreg_EnumValue_impl(module, key, index); exit: @@ -483,8 +495,9 @@ winreg_ExpandEnvironmentStrings(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; Py_UNICODE *string; - if (!PyArg_Parse(arg, "u:ExpandEnvironmentStrings", &string)) + if (!PyArg_Parse(arg, "u:ExpandEnvironmentStrings", &string)) { goto exit; + } return_value = winreg_ExpandEnvironmentStrings_impl(module, string); exit: @@ -522,8 +535,9 @@ winreg_FlushKey(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; HKEY key; - if (!PyArg_Parse(arg, "O&:FlushKey", clinic_HKEY_converter, &key)) + if (!PyArg_Parse(arg, "O&:FlushKey", clinic_HKEY_converter, &key)) { goto exit; + } return_value = winreg_FlushKey_impl(module, key); exit: @@ -574,8 +588,9 @@ winreg_LoadKey(PyModuleDef *module, PyObject *args) Py_UNICODE *file_name; if (!PyArg_ParseTuple(args, "O&uu:LoadKey", - clinic_HKEY_converter, &key, &sub_key, &file_name)) + clinic_HKEY_converter, &key, &sub_key, &file_name)) { goto exit; + } return_value = winreg_LoadKey_impl(module, key, sub_key, file_name); exit: @@ -620,11 +635,13 @@ winreg_OpenKey(PyModuleDef *module, PyObject *args, PyObject *kwargs) HKEY _return_value; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:OpenKey", _keywords, - clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) + clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; + } _return_value = winreg_OpenKey_impl(module, key, sub_key, reserved, access); - if (_return_value == NULL) + if (_return_value == NULL) { goto exit; + } return_value = PyHKEY_FromHKEY(_return_value); exit: @@ -669,11 +686,13 @@ winreg_OpenKeyEx(PyModuleDef *module, PyObject *args, PyObject *kwargs) HKEY _return_value; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:OpenKeyEx", _keywords, - clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) + clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; + } _return_value = winreg_OpenKeyEx_impl(module, key, sub_key, reserved, access); - if (_return_value == NULL) + if (_return_value == NULL) { goto exit; + } return_value = PyHKEY_FromHKEY(_return_value); exit: @@ -707,8 +726,9 @@ winreg_QueryInfoKey(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; HKEY key; - if (!PyArg_Parse(arg, "O&:QueryInfoKey", clinic_HKEY_converter, &key)) + if (!PyArg_Parse(arg, "O&:QueryInfoKey", clinic_HKEY_converter, &key)) { goto exit; + } return_value = winreg_QueryInfoKey_impl(module, key); exit: @@ -749,8 +769,9 @@ winreg_QueryValue(PyModuleDef *module, PyObject *args) Py_UNICODE *sub_key; if (!PyArg_ParseTuple(args, "O&Z:QueryValue", - clinic_HKEY_converter, &key, &sub_key)) + clinic_HKEY_converter, &key, &sub_key)) { goto exit; + } return_value = winreg_QueryValue_impl(module, key, sub_key); exit: @@ -787,8 +808,9 @@ winreg_QueryValueEx(PyModuleDef *module, PyObject *args) Py_UNICODE *name; if (!PyArg_ParseTuple(args, "O&Z:QueryValueEx", - clinic_HKEY_converter, &key, &name)) + clinic_HKEY_converter, &key, &name)) { goto exit; + } return_value = winreg_QueryValueEx_impl(module, key, name); exit: @@ -830,8 +852,9 @@ winreg_SaveKey(PyModuleDef *module, PyObject *args) Py_UNICODE *file_name; if (!PyArg_ParseTuple(args, "O&u:SaveKey", - clinic_HKEY_converter, &key, &file_name)) + clinic_HKEY_converter, &key, &file_name)) { goto exit; + } return_value = winreg_SaveKey_impl(module, key, file_name); exit: @@ -883,8 +906,9 @@ winreg_SetValue(PyModuleDef *module, PyObject *args) Py_ssize_clean_t value_length; if (!PyArg_ParseTuple(args, "O&Zku#:SetValue", - clinic_HKEY_converter, &key, &sub_key, &type, &value, &value_length)) + clinic_HKEY_converter, &key, &sub_key, &type, &value, &value_length)) { goto exit; + } return_value = winreg_SetValue_impl(module, key, sub_key, type, value, value_length); exit: @@ -952,8 +976,9 @@ winreg_SetValueEx(PyModuleDef *module, PyObject *args) PyObject *value; if (!PyArg_ParseTuple(args, "O&ZOkO:SetValueEx", - clinic_HKEY_converter, &key, &value_name, &reserved, &type, &value)) + clinic_HKEY_converter, &key, &value_name, &reserved, &type, &value)) { goto exit; + } return_value = winreg_SetValueEx_impl(module, key, value_name, reserved, type, value); exit: @@ -987,8 +1012,9 @@ winreg_DisableReflectionKey(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; HKEY key; - if (!PyArg_Parse(arg, "O&:DisableReflectionKey", clinic_HKEY_converter, &key)) + if (!PyArg_Parse(arg, "O&:DisableReflectionKey", clinic_HKEY_converter, &key)) { goto exit; + } return_value = winreg_DisableReflectionKey_impl(module, key); exit: @@ -1020,8 +1046,9 @@ winreg_EnableReflectionKey(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; HKEY key; - if (!PyArg_Parse(arg, "O&:EnableReflectionKey", clinic_HKEY_converter, &key)) + if (!PyArg_Parse(arg, "O&:EnableReflectionKey", clinic_HKEY_converter, &key)) { goto exit; + } return_value = winreg_EnableReflectionKey_impl(module, key); exit: @@ -1051,11 +1078,12 @@ winreg_QueryReflectionKey(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; HKEY key; - if (!PyArg_Parse(arg, "O&:QueryReflectionKey", clinic_HKEY_converter, &key)) + if (!PyArg_Parse(arg, "O&:QueryReflectionKey", clinic_HKEY_converter, &key)) { goto exit; + } return_value = winreg_QueryReflectionKey_impl(module, key); exit: return return_value; } -/*[clinic end generated code: output=0b71782e9b37b12a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ca128bfa212d8d1f input=a9049054013a1b77]*/ -- cgit v1.2.1 From 96d299b2b87dd2311bcc94cbab7b1cfa2c30ccba Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 14 Aug 2016 10:52:18 +0300 Subject: Issue #27574: Decreased an overhead of parsing keyword arguments in functions implemented with using Argument Clinic. --- PC/clinic/winreg.c.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'PC/clinic/winreg.c.h') diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index 264dcf0c61..e7836e4fe2 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -87,12 +87,13 @@ static PyObject * winreg_HKEYType___exit__(PyHKEYObject *self, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - static char *_keywords[] = {"exc_type", "exc_value", "traceback", NULL}; + static const char * const _keywords[] = {"exc_type", "exc_value", "traceback", NULL}; + static _PyArg_Parser _parser = {"OOO:__exit__", _keywords, 0}; PyObject *exc_type; PyObject *exc_value; PyObject *traceback; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:__exit__", _keywords, + if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, &exc_type, &exc_value, &traceback)) { goto exit; } @@ -244,14 +245,15 @@ static PyObject * winreg_CreateKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - static char *_keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static _PyArg_Parser _parser = {"O&Z|ii:CreateKeyEx", _keywords, 0}; HKEY key; Py_UNICODE *sub_key; int reserved = 0; REGSAM access = KEY_WRITE; HKEY _return_value; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:CreateKeyEx", _keywords, + if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; } @@ -342,13 +344,14 @@ static PyObject * winreg_DeleteKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - static char *_keywords[] = {"key", "sub_key", "access", "reserved", NULL}; + static const char * const _keywords[] = {"key", "sub_key", "access", "reserved", NULL}; + static _PyArg_Parser _parser = {"O&u|ii:DeleteKeyEx", _keywords, 0}; HKEY key; Py_UNICODE *sub_key; REGSAM access = KEY_WOW64_64KEY; int reserved = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&u|ii:DeleteKeyEx", _keywords, + if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, clinic_HKEY_converter, &key, &sub_key, &access, &reserved)) { goto exit; } @@ -627,14 +630,15 @@ static PyObject * winreg_OpenKey(PyObject *module, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - static char *_keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static _PyArg_Parser _parser = {"O&Z|ii:OpenKey", _keywords, 0}; HKEY key; Py_UNICODE *sub_key; int reserved = 0; REGSAM access = KEY_READ; HKEY _return_value; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:OpenKey", _keywords, + if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; } @@ -678,14 +682,15 @@ static PyObject * winreg_OpenKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - static char *_keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; + static _PyArg_Parser _parser = {"O&Z|ii:OpenKeyEx", _keywords, 0}; HKEY key; Py_UNICODE *sub_key; int reserved = 0; REGSAM access = KEY_READ; HKEY _return_value; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:OpenKeyEx", _keywords, + if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; } @@ -1086,4 +1091,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=c35ce71f825424d1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5b53d19cbe3f37cd input=a9049054013a1b77]*/ -- cgit v1.2.1 From daa2ed44798ad45ac665321cae21a23661d0e044 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 9 Sep 2016 20:00:13 -0700 Subject: Issue #27810: Rerun Argument Clinic on all modules --- PC/clinic/winreg.c.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'PC/clinic/winreg.c.h') diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index e7836e4fe2..c7d5b9e452 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -77,14 +77,14 @@ PyDoc_STRVAR(winreg_HKEYType___exit____doc__, "\n"); #define WINREG_HKEYTYPE___EXIT___METHODDEF \ - {"__exit__", (PyCFunction)winreg_HKEYType___exit__, METH_VARARGS|METH_KEYWORDS, winreg_HKEYType___exit____doc__}, + {"__exit__", (PyCFunction)winreg_HKEYType___exit__, METH_FASTCALL, winreg_HKEYType___exit____doc__}, static PyObject * winreg_HKEYType___exit___impl(PyHKEYObject *self, PyObject *exc_type, PyObject *exc_value, PyObject *traceback); static PyObject * -winreg_HKEYType___exit__(PyHKEYObject *self, PyObject *args, PyObject *kwargs) +winreg_HKEYType___exit__(PyHKEYObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; static const char * const _keywords[] = {"exc_type", "exc_value", "traceback", NULL}; @@ -93,7 +93,7 @@ winreg_HKEYType___exit__(PyHKEYObject *self, PyObject *args, PyObject *kwargs) PyObject *exc_value; PyObject *traceback; - if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, &exc_type, &exc_value, &traceback)) { goto exit; } @@ -235,14 +235,14 @@ PyDoc_STRVAR(winreg_CreateKeyEx__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_CREATEKEYEX_METHODDEF \ - {"CreateKeyEx", (PyCFunction)winreg_CreateKeyEx, METH_VARARGS|METH_KEYWORDS, winreg_CreateKeyEx__doc__}, + {"CreateKeyEx", (PyCFunction)winreg_CreateKeyEx, METH_FASTCALL, winreg_CreateKeyEx__doc__}, static HKEY winreg_CreateKeyEx_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, int reserved, REGSAM access); static PyObject * -winreg_CreateKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) +winreg_CreateKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; @@ -253,7 +253,7 @@ winreg_CreateKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) REGSAM access = KEY_WRITE; HKEY _return_value; - if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; } @@ -334,14 +334,14 @@ PyDoc_STRVAR(winreg_DeleteKeyEx__doc__, "On unsupported Windows versions, NotImplementedError is raised."); #define WINREG_DELETEKEYEX_METHODDEF \ - {"DeleteKeyEx", (PyCFunction)winreg_DeleteKeyEx, METH_VARARGS|METH_KEYWORDS, winreg_DeleteKeyEx__doc__}, + {"DeleteKeyEx", (PyCFunction)winreg_DeleteKeyEx, METH_FASTCALL, winreg_DeleteKeyEx__doc__}, static PyObject * winreg_DeleteKeyEx_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, REGSAM access, int reserved); static PyObject * -winreg_DeleteKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) +winreg_DeleteKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; static const char * const _keywords[] = {"key", "sub_key", "access", "reserved", NULL}; @@ -351,7 +351,7 @@ winreg_DeleteKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) REGSAM access = KEY_WOW64_64KEY; int reserved = 0; - if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, clinic_HKEY_converter, &key, &sub_key, &access, &reserved)) { goto exit; } @@ -620,14 +620,14 @@ PyDoc_STRVAR(winreg_OpenKey__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_OPENKEY_METHODDEF \ - {"OpenKey", (PyCFunction)winreg_OpenKey, METH_VARARGS|METH_KEYWORDS, winreg_OpenKey__doc__}, + {"OpenKey", (PyCFunction)winreg_OpenKey, METH_FASTCALL, winreg_OpenKey__doc__}, static HKEY winreg_OpenKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, int reserved, REGSAM access); static PyObject * -winreg_OpenKey(PyObject *module, PyObject *args, PyObject *kwargs) +winreg_OpenKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; @@ -638,7 +638,7 @@ winreg_OpenKey(PyObject *module, PyObject *args, PyObject *kwargs) REGSAM access = KEY_READ; HKEY _return_value; - if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; } @@ -672,14 +672,14 @@ PyDoc_STRVAR(winreg_OpenKeyEx__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_OPENKEYEX_METHODDEF \ - {"OpenKeyEx", (PyCFunction)winreg_OpenKeyEx, METH_VARARGS|METH_KEYWORDS, winreg_OpenKeyEx__doc__}, + {"OpenKeyEx", (PyCFunction)winreg_OpenKeyEx, METH_FASTCALL, winreg_OpenKeyEx__doc__}, static HKEY winreg_OpenKeyEx_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, int reserved, REGSAM access); static PyObject * -winreg_OpenKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) +winreg_OpenKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL}; @@ -690,7 +690,7 @@ winreg_OpenKeyEx(PyObject *module, PyObject *args, PyObject *kwargs) REGSAM access = KEY_READ; HKEY _return_value; - if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; } @@ -1091,4 +1091,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=5b53d19cbe3f37cd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=16dd06be6e14b86e input=a9049054013a1b77]*/ -- cgit v1.2.1