diff options
Diffstat (limited to 'Modules/cjkcodecs/clinic/multibytecodec.c.h')
-rw-r--r-- | Modules/cjkcodecs/clinic/multibytecodec.c.h | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index 1dfb9a1..6051524 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -493,13 +493,15 @@ _multibytecodec_MultibyteStreamWriter_write(MultibyteStreamWriterObject *self, P { PyObject *return_value = NULL; static const char * const _keywords[] = {"", NULL}; - static _PyArg_Parser _parser = {"O:write", _keywords, 0}; + static _PyArg_Parser _parser = {NULL, _keywords, "write", 0}; + PyObject *argsbuf[1]; PyObject *strobj; - if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, - &strobj)) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); + if (!args) { goto exit; } + strobj = args[0]; return_value = _multibytecodec_MultibyteStreamWriter_write_impl(self, cls, strobj); exit: @@ -524,13 +526,15 @@ _multibytecodec_MultibyteStreamWriter_writelines(MultibyteStreamWriterObject *se { PyObject *return_value = NULL; static const char * const _keywords[] = {"", NULL}; - static _PyArg_Parser _parser = {"O:writelines", _keywords, 0}; + static _PyArg_Parser _parser = {NULL, _keywords, "writelines", 0}; + PyObject *argsbuf[1]; PyObject *lines; - if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, - &lines)) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); + if (!args) { goto exit; } + lines = args[0]; return_value = _multibytecodec_MultibyteStreamWriter_writelines_impl(self, cls, lines); exit: @@ -552,18 +556,11 @@ _multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *se static PyObject * _multibytecodec_MultibyteStreamWriter_reset(MultibyteStreamWriterObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - static const char * const _keywords[] = { NULL}; - static _PyArg_Parser _parser = {":reset", _keywords, 0}; - - if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser - )) { - goto exit; + if (nargs) { + PyErr_SetString(PyExc_TypeError, "reset() takes no arguments"); + return NULL; } - return_value = _multibytecodec_MultibyteStreamWriter_reset_impl(self, cls); - -exit: - return return_value; + return _multibytecodec_MultibyteStreamWriter_reset_impl(self, cls); } PyDoc_STRVAR(_multibytecodec___create_codec__doc__, @@ -573,4 +570,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=8813c05077580bda input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0ee00c9f6883afe9 input=a9049054013a1b77]*/ |