From f3ce3914b9911f922b605c1655e10bfc81329f1e Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 28 Feb 2025 11:35:55 +0100 Subject: [PATCH 1/9] gh-111178: Change Argument Clinic signature for METH_O Use "PyObject*" for METH_O functions to fix an undefined behavior. --- Tools/clinic/libclinic/clanguage.py | 5 +++-- Tools/clinic/libclinic/parse_args.py | 14 +++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Tools/clinic/libclinic/clanguage.py b/Tools/clinic/libclinic/clanguage.py index 32d2c045b06bca..9e7fa7a7f58f95 100644 --- a/Tools/clinic/libclinic/clanguage.py +++ b/Tools/clinic/libclinic/clanguage.py @@ -423,14 +423,14 @@ def render_function( # HACK # when we're METH_O, but have a custom return converter, - # we use "impl_parameters" for the parsing function + # we use "parser_parameters" for the parsing function # because that works better. but that means we must # suppress actually declaring the impl's parameters # as variables in the parsing function. but since it's # METH_O, we have exactly one anyway, so we know exactly # where it is. if ("METH_O" in templates['methoddef_define'] and - '{impl_parameters}' in templates['parser_prototype']): + '{parser_parameters}' in templates['parser_prototype']): data.declarations.pop(0) full_name = f.full_name @@ -475,6 +475,7 @@ def render_function( else: template_dict['parse_arguments_comma'] = ''; template_dict['impl_parameters'] = ", ".join(data.impl_parameters) + template_dict['parser_parameters'] = ", ".join(data.impl_parameters[1:]) template_dict['impl_arguments'] = ", ".join(data.impl_arguments) template_dict['return_conversion'] = libclinic.format_escape("".join(data.return_conversion).rstrip()) diff --git a/Tools/clinic/libclinic/parse_args.py b/Tools/clinic/libclinic/parse_args.py index ff4731e99b98d4..0e090544c65bf1 100644 --- a/Tools/clinic/libclinic/parse_args.py +++ b/Tools/clinic/libclinic/parse_args.py @@ -134,7 +134,7 @@ def declare_parser( """) METH_O_PROTOTYPE: Final[str] = libclinic.normalize_snippet(""" static PyObject * - {c_basename}({impl_parameters}) + {c_basename}({self_type}{self_name}, {parser_parameters}) """) DOCSTRING_PROTOTYPE_VAR: Final[str] = libclinic.normalize_snippet(""" PyDoc_VAR({c_basename}__doc__); @@ -195,6 +195,7 @@ class ParseArgsCodeGen: # Function parameters parameters: list[Parameter] + self_parameter: Parameter converters: list[CConverter] # Is 'defining_class' used for the first parameter? @@ -236,8 +237,8 @@ def __init__(self, func: Function, codegen: CodeGen) -> None: self.codegen = codegen self.parameters = list(self.func.parameters.values()) - first_param = self.parameters.pop(0) - if not isinstance(first_param.converter, self_converter): + self.self_parameter = self.parameters.pop(0) + if not isinstance(self.self_parameter.converter, self_converter): raise ValueError("the first parameter must use self_converter") self.requires_defining_class = False @@ -290,8 +291,11 @@ def use_meth_o(self) -> bool: and not self.is_new_or_init()) def use_simple_return(self) -> bool: - return (self.func.return_converter.type == 'PyObject *' - and not self.func.critical_section) + pyobject = 'PyObject *' + return (self.func.return_converter.type == pyobject + and not self.func.critical_section + and self.self_parameter.converter.type in (pyobject, None) + and self.self_parameter.converter.specified_type in (pyobject, None)) def select_prototypes(self) -> None: self.docstring_prototype = '' From c0a704ef8dee7d50424f8b0ef791eb5d661539df Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 28 Feb 2025 12:11:36 +0100 Subject: [PATCH 2/9] run make clinic --- Modules/_asynciomodule.c | 8 +- Modules/_cursesmodule.c | 4 +- Modules/_elementtree.c | 22 +-- Modules/_hashopenssl.c | 4 +- Modules/_io/bufferedio.c | 4 +- Modules/_io/bytesio.c | 8 +- Modules/_io/clinic/bufferedio.c.h | 15 +- Modules/_io/clinic/bytesio.c.h | 85 ++++++++++-- Modules/_io/clinic/fileio.c.h | 53 +++++-- Modules/_io/clinic/stringio.c.h | 6 +- Modules/_io/clinic/textio.c.h | 28 +++- Modules/_io/clinic/winconsoleio.c.h | 41 ++++-- Modules/_io/textio.c | 6 +- Modules/_multiprocessing/clinic/semaphore.c.h | 26 +++- Modules/_sqlite/clinic/blob.c.h | 20 ++- Modules/_sqlite/clinic/connection.c.h | 46 ++++++- Modules/_sqlite/clinic/cursor.c.h | 33 ++++- Modules/_sqlite/clinic/row.c.h | 8 +- Modules/_sqlite/connection.c | 6 +- Modules/_sqlite/cursor.c | 4 +- Modules/_sre/clinic/sre.c.h | 58 +++++++- Modules/_sre/sre.c | 8 +- Modules/_ssl/clinic/cert.c.h | 8 +- Modules/_struct.c | 4 +- Modules/_tkinter.c | 24 ++-- Modules/arraymodule.c | 4 +- Modules/blake2module.c | 4 +- Modules/cjkcodecs/clinic/multibytecodec.c.h | 41 ++++-- Modules/clinic/_asynciomodule.c.h | 36 ++++- Modules/clinic/_bz2module.c.h | 8 +- Modules/clinic/_collectionsmodule.c.h | 26 ++-- Modules/clinic/_curses_panel.c.h | 71 ++++++++-- Modules/clinic/_cursesmodule.c.h | 21 ++- Modules/clinic/_dbmmodule.c.h | 26 +++- Modules/clinic/_elementtree.c.h | 129 ++++++++++++++++-- Modules/clinic/_gdbmmodule.c.h | 53 +++++-- Modules/clinic/_hashopenssl.c.h | 51 ++++++- Modules/clinic/_lsprof.c.h | 23 +++- Modules/clinic/_lzmamodule.c.h | 8 +- Modules/clinic/_pickle.c.h | 53 +++++-- Modules/clinic/_randommodule.c.h | 4 +- Modules/clinic/_ssl.c.h | 12 +- Modules/clinic/_struct.c.h | 15 +- Modules/clinic/_testmultiphase.c.h | 29 +++- Modules/clinic/_tkinter.c.h | 116 +++++++++++++++- Modules/clinic/_winapi.c.h | 14 +- Modules/clinic/arraymodule.c.h | 40 ++++-- Modules/clinic/blake2module.c.h | 33 ++++- Modules/clinic/md5module.c.h | 36 ++++- Modules/clinic/overlapped.c.h | 8 +- Modules/clinic/posixmodule.c.h | 14 +- Modules/clinic/pyexpat.c.h | 20 ++- Modules/clinic/selectmodule.c.h | 20 ++- Modules/clinic/sha1module.c.h | 36 ++++- Modules/clinic/sha2module.c.h | 70 ++++++++-- Modules/clinic/sha3module.c.h | 33 ++++- Modules/clinic/socketmodule.c.h | 8 +- Modules/clinic/zlibmodule.c.h | 38 ++++-- Modules/md5module.c | 4 +- Modules/sha1module.c | 4 +- Modules/sha2module.c | 8 +- Modules/sha3module.c | 4 +- Objects/bytesobject.c | 4 +- Objects/clinic/bytearrayobject.c.h | 22 ++- Objects/clinic/bytesobject.c.h | 21 ++- Objects/clinic/classobject.c.h | 8 +- Objects/clinic/complexobject.c.h | 20 ++- Objects/clinic/dictobject.c.h | 57 ++++++-- Objects/clinic/exceptions.c.h | 12 +- Objects/clinic/listobject.c.h | 44 +++++- Objects/clinic/memoryobject.c.h | 33 ++++- Objects/clinic/setobject.c.h | 31 +++-- Objects/clinic/tupleobject.c.h | 21 ++- Objects/clinic/typeobject.c.h | 30 +++- Objects/clinic/typevarobject.c.h | 83 +++++++++-- Objects/clinic/unicodeobject.c.h | 8 +- Objects/dictobject.c | 4 +- Objects/listobject.c | 8 +- Objects/memoryobject.c | 4 +- Objects/setobject.c | 4 +- Objects/tupleobject.c | 4 +- Objects/typevarobject.c | 12 +- PC/clinic/winreg.c.h | 14 +- Python/bltinmodule.c | 4 +- Python/clinic/bltinmodule.c.h | 15 +- Python/clinic/context.c.h | 58 +++++++- Python/clinic/instruction_sequence.c.h | 14 +- Python/context.c | 8 +- 88 files changed, 1780 insertions(+), 412 deletions(-) diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index c743c246cb4a67..f5d62bb8efe905 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -2749,8 +2749,8 @@ _asyncio.Task.set_result [clinic start generated code]*/ static PyObject * -_asyncio_Task_set_result(TaskObj *self, PyObject *result) -/*[clinic end generated code: output=1dcae308bfcba318 input=9d1a00c07be41bab]*/ +_asyncio_Task_set_result_impl(TaskObj *self, PyObject *result) +/*[clinic end generated code: output=e9d8e3cdaf18e258 input=9d1a00c07be41bab]*/ { PyErr_SetString(PyExc_RuntimeError, "Task does not support set_result operation"); @@ -2765,8 +2765,8 @@ _asyncio.Task.set_exception [clinic start generated code]*/ static PyObject * -_asyncio_Task_set_exception(TaskObj *self, PyObject *exception) -/*[clinic end generated code: output=bc377fc28067303d input=9a8f65c83dcf893a]*/ +_asyncio_Task_set_exception_impl(TaskObj *self, PyObject *exception) +/*[clinic end generated code: output=96a91790c192cc7d input=9a8f65c83dcf893a]*/ { PyErr_SetString(PyExc_RuntimeError, "Task does not support set_exception operation"); diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 5bfc6a1383f142..2c88bd3cdf2347 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -2309,8 +2309,8 @@ This information can be later retrieved using the getwin() function. [clinic start generated code]*/ static PyObject * -_curses_window_putwin(PyCursesWindowObject *self, PyObject *file) -/*[clinic end generated code: output=3a25e2a5e7a040ac input=0608648e09c8ea0a]*/ +_curses_window_putwin_impl(PyCursesWindowObject *self, PyObject *file) +/*[clinic end generated code: output=fdae68ac59b0281b input=0608648e09c8ea0a]*/ { /* We have to simulate this by writing to a temporary FILE*, then reading back, then writing to the argument file. */ diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index b5b0b82571f882..d20bbcd21fd371 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -2951,8 +2951,8 @@ _elementtree.TreeBuilder.data [clinic start generated code]*/ static PyObject * -_elementtree_TreeBuilder_data(TreeBuilderObject *self, PyObject *data) -/*[clinic end generated code: output=69144c7100795bb2 input=a0540c532b284d29]*/ +_elementtree_TreeBuilder_data_impl(TreeBuilderObject *self, PyObject *data) +/*[clinic end generated code: output=dfa02b68f732b8c0 input=a0540c532b284d29]*/ { return treebuilder_handle_data(self, data); } @@ -2966,8 +2966,8 @@ _elementtree.TreeBuilder.end [clinic start generated code]*/ static PyObject * -_elementtree_TreeBuilder_end(TreeBuilderObject *self, PyObject *tag) -/*[clinic end generated code: output=9a98727cc691cd9d input=22dc3674236f5745]*/ +_elementtree_TreeBuilder_end_impl(TreeBuilderObject *self, PyObject *tag) +/*[clinic end generated code: output=84cb6ca9008ec740 input=22dc3674236f5745]*/ { return treebuilder_handle_end(self, tag); } @@ -2981,8 +2981,9 @@ _elementtree.TreeBuilder.comment [clinic start generated code]*/ static PyObject * -_elementtree_TreeBuilder_comment(TreeBuilderObject *self, PyObject *text) -/*[clinic end generated code: output=22835be41deeaa27 input=47e7ebc48ed01dfa]*/ +_elementtree_TreeBuilder_comment_impl(TreeBuilderObject *self, + PyObject *text) +/*[clinic end generated code: output=a555ef39027c3823 input=47e7ebc48ed01dfa]*/ { return treebuilder_handle_comment(self, text); } @@ -3949,8 +3950,8 @@ _elementtree.XMLParser.feed [clinic start generated code]*/ static PyObject * -_elementtree_XMLParser_feed(XMLParserObject *self, PyObject *data) -/*[clinic end generated code: output=e42b6a78eec7446d input=fe231b6b8de3ce1f]*/ +_elementtree_XMLParser_feed_impl(XMLParserObject *self, PyObject *data) +/*[clinic end generated code: output=503e6fbf1adf17ab input=fe231b6b8de3ce1f]*/ { /* feed data to parser */ @@ -3997,8 +3998,9 @@ _elementtree.XMLParser._parse_whole [clinic start generated code]*/ static PyObject * -_elementtree_XMLParser__parse_whole(XMLParserObject *self, PyObject *file) -/*[clinic end generated code: output=f797197bb818dda3 input=19ecc893b6f3e752]*/ +_elementtree_XMLParser__parse_whole_impl(XMLParserObject *self, + PyObject *file) +/*[clinic end generated code: output=60718a4e63d237d2 input=19ecc893b6f3e752]*/ { /* (internal) parse the whole input, until end of stream */ PyObject* reader; diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 3f1deb81c6375f..f34c0b0aca92e9 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -644,8 +644,8 @@ Update this hash object's state with the provided string. [clinic start generated code]*/ static PyObject * -EVP_update(EVPobject *self, PyObject *obj) -/*[clinic end generated code: output=ec1d55ed2432e966 input=9b30ec848f015501]*/ +EVP_update_impl(EVPobject *self, PyObject *obj) +/*[clinic end generated code: output=d56f91c68348f95f input=9b30ec848f015501]*/ { int result; Py_buffer view; diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 53c4702f673786..44bc1af593b512 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -472,8 +472,8 @@ _io._Buffered._dealloc_warn [clinic start generated code]*/ static PyObject * -_io__Buffered__dealloc_warn(buffered *self, PyObject *source) -/*[clinic end generated code: output=690dcc3df8967162 input=8f845f2a4786391c]*/ +_io__Buffered__dealloc_warn_impl(buffered *self, PyObject *source) +/*[clinic end generated code: output=d8db21c6dec0e614 input=8f845f2a4786391c]*/ { if (self->ok && self->raw) { PyObject *r; diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index dc4e40b9f09a1d..6097d2817531aa 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -710,8 +710,8 @@ Return the number of bytes written. [clinic start generated code]*/ static PyObject * -_io_BytesIO_write(bytesio *self, PyObject *b) -/*[clinic end generated code: output=53316d99800a0b95 input=f5ec7c8c64ed720a]*/ +_io_BytesIO_write_impl(bytesio *self, PyObject *b) +/*[clinic end generated code: output=d3e46bcec8d9e21c input=f5ec7c8c64ed720a]*/ { Py_ssize_t n = write_bytes(self, b); return n >= 0 ? PyLong_FromSsize_t(n) : NULL; @@ -730,8 +730,8 @@ each element. [clinic start generated code]*/ static PyObject * -_io_BytesIO_writelines(bytesio *self, PyObject *lines) -/*[clinic end generated code: output=7f33aa3271c91752 input=e972539176fc8fc1]*/ +_io_BytesIO_writelines_impl(bytesio *self, PyObject *lines) +/*[clinic end generated code: output=03a43a75773bc397 input=e972539176fc8fc1]*/ { PyObject *it, *item; diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index 8ab8000fafee02..3345ae4c7f805f 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -307,6 +307,19 @@ PyDoc_STRVAR(_io__Buffered__dealloc_warn__doc__, #define _IO__BUFFERED__DEALLOC_WARN_METHODDEF \ {"_dealloc_warn", (PyCFunction)_io__Buffered__dealloc_warn, METH_O, _io__Buffered__dealloc_warn__doc__}, +static PyObject * +_io__Buffered__dealloc_warn_impl(buffered *self, PyObject *source); + +static PyObject * +_io__Buffered__dealloc_warn(PyObject *self, PyObject *source) +{ + PyObject *return_value = NULL; + + return_value = _io__Buffered__dealloc_warn_impl((buffered *)self, source); + + return return_value; +} + PyDoc_STRVAR(_io__Buffered_simple_flush__doc__, "flush($self, /)\n" "--\n" @@ -1246,4 +1259,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=f019d29701ba2556 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1a0562c66776fd53 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index 5528df952c33fb..987cf3ba3e5662 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -24,7 +24,11 @@ _io_BytesIO_readable_impl(bytesio *self); static PyObject * _io_BytesIO_readable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_BytesIO_readable_impl((bytesio *)self); + PyObject *return_value = NULL; + + return_value = _io_BytesIO_readable_impl((bytesio *)self); + + return return_value; } PyDoc_STRVAR(_io_BytesIO_writable__doc__, @@ -42,7 +46,11 @@ _io_BytesIO_writable_impl(bytesio *self); static PyObject * _io_BytesIO_writable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_BytesIO_writable_impl((bytesio *)self); + PyObject *return_value = NULL; + + return_value = _io_BytesIO_writable_impl((bytesio *)self); + + return return_value; } PyDoc_STRVAR(_io_BytesIO_seekable__doc__, @@ -60,7 +68,11 @@ _io_BytesIO_seekable_impl(bytesio *self); static PyObject * _io_BytesIO_seekable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_BytesIO_seekable_impl((bytesio *)self); + PyObject *return_value = NULL; + + return_value = _io_BytesIO_seekable_impl((bytesio *)self); + + return return_value; } PyDoc_STRVAR(_io_BytesIO_flush__doc__, @@ -78,7 +90,11 @@ _io_BytesIO_flush_impl(bytesio *self); static PyObject * _io_BytesIO_flush(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_BytesIO_flush_impl((bytesio *)self); + PyObject *return_value = NULL; + + return_value = _io_BytesIO_flush_impl((bytesio *)self); + + return return_value; } PyDoc_STRVAR(_io_BytesIO_getbuffer__doc__, @@ -96,11 +112,16 @@ _io_BytesIO_getbuffer_impl(bytesio *self, PyTypeObject *cls); static PyObject * _io_BytesIO_getbuffer(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "getbuffer() takes no arguments"); - return NULL; + goto exit; } - return _io_BytesIO_getbuffer_impl((bytesio *)self, cls); + return_value = _io_BytesIO_getbuffer_impl((bytesio *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_io_BytesIO_getvalue__doc__, @@ -118,7 +139,11 @@ _io_BytesIO_getvalue_impl(bytesio *self); static PyObject * _io_BytesIO_getvalue(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_BytesIO_getvalue_impl((bytesio *)self); + PyObject *return_value = NULL; + + return_value = _io_BytesIO_getvalue_impl((bytesio *)self); + + return return_value; } PyDoc_STRVAR(_io_BytesIO_isatty__doc__, @@ -138,7 +163,11 @@ _io_BytesIO_isatty_impl(bytesio *self); static PyObject * _io_BytesIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_BytesIO_isatty_impl((bytesio *)self); + PyObject *return_value = NULL; + + return_value = _io_BytesIO_isatty_impl((bytesio *)self); + + return return_value; } PyDoc_STRVAR(_io_BytesIO_tell__doc__, @@ -156,7 +185,11 @@ _io_BytesIO_tell_impl(bytesio *self); static PyObject * _io_BytesIO_tell(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_BytesIO_tell_impl((bytesio *)self); + PyObject *return_value = NULL; + + return_value = _io_BytesIO_tell_impl((bytesio *)self); + + return return_value; } PyDoc_STRVAR(_io_BytesIO_read__doc__, @@ -445,6 +478,19 @@ PyDoc_STRVAR(_io_BytesIO_write__doc__, #define _IO_BYTESIO_WRITE_METHODDEF \ {"write", (PyCFunction)_io_BytesIO_write, METH_O, _io_BytesIO_write__doc__}, +static PyObject * +_io_BytesIO_write_impl(bytesio *self, PyObject *b); + +static PyObject * +_io_BytesIO_write(PyObject *self, PyObject *b) +{ + PyObject *return_value = NULL; + + return_value = _io_BytesIO_write_impl((bytesio *)self, b); + + return return_value; +} + PyDoc_STRVAR(_io_BytesIO_writelines__doc__, "writelines($self, lines, /)\n" "--\n" @@ -458,6 +504,19 @@ PyDoc_STRVAR(_io_BytesIO_writelines__doc__, #define _IO_BYTESIO_WRITELINES_METHODDEF \ {"writelines", (PyCFunction)_io_BytesIO_writelines, METH_O, _io_BytesIO_writelines__doc__}, +static PyObject * +_io_BytesIO_writelines_impl(bytesio *self, PyObject *lines); + +static PyObject * +_io_BytesIO_writelines(PyObject *self, PyObject *lines) +{ + PyObject *return_value = NULL; + + return_value = _io_BytesIO_writelines_impl((bytesio *)self, lines); + + return return_value; +} + PyDoc_STRVAR(_io_BytesIO_close__doc__, "close($self, /)\n" "--\n" @@ -473,7 +532,11 @@ _io_BytesIO_close_impl(bytesio *self); static PyObject * _io_BytesIO_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_BytesIO_close_impl((bytesio *)self); + PyObject *return_value = NULL; + + return_value = _io_BytesIO_close_impl((bytesio *)self); + + return return_value; } PyDoc_STRVAR(_io_BytesIO___init____doc__, @@ -535,4 +598,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=8a5e153bc7584b55 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=81a64e1ff7660977 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index 22d27bce67799e..b81a5af1ee3444 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -27,11 +27,16 @@ _io_FileIO_close_impl(fileio *self, PyTypeObject *cls); static PyObject * _io_FileIO_close(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "close() takes no arguments"); - return NULL; + goto exit; } - return _io_FileIO_close_impl((fileio *)self, cls); + return_value = _io_FileIO_close_impl((fileio *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_io_FileIO___init____doc__, @@ -153,7 +158,11 @@ _io_FileIO_fileno_impl(fileio *self); static PyObject * _io_FileIO_fileno(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_FileIO_fileno_impl((fileio *)self); + PyObject *return_value = NULL; + + return_value = _io_FileIO_fileno_impl((fileio *)self); + + return return_value; } PyDoc_STRVAR(_io_FileIO_readable__doc__, @@ -171,7 +180,11 @@ _io_FileIO_readable_impl(fileio *self); static PyObject * _io_FileIO_readable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_FileIO_readable_impl((fileio *)self); + PyObject *return_value = NULL; + + return_value = _io_FileIO_readable_impl((fileio *)self); + + return return_value; } PyDoc_STRVAR(_io_FileIO_writable__doc__, @@ -189,7 +202,11 @@ _io_FileIO_writable_impl(fileio *self); static PyObject * _io_FileIO_writable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_FileIO_writable_impl((fileio *)self); + PyObject *return_value = NULL; + + return_value = _io_FileIO_writable_impl((fileio *)self); + + return return_value; } PyDoc_STRVAR(_io_FileIO_seekable__doc__, @@ -207,7 +224,11 @@ _io_FileIO_seekable_impl(fileio *self); static PyObject * _io_FileIO_seekable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_FileIO_seekable_impl((fileio *)self); + PyObject *return_value = NULL; + + return_value = _io_FileIO_seekable_impl((fileio *)self); + + return return_value; } PyDoc_STRVAR(_io_FileIO_readinto__doc__, @@ -280,7 +301,11 @@ _io_FileIO_readall_impl(fileio *self); static PyObject * _io_FileIO_readall(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_FileIO_readall_impl((fileio *)self); + PyObject *return_value = NULL; + + return_value = _io_FileIO_readall_impl((fileio *)self); + + return return_value; } PyDoc_STRVAR(_io_FileIO_read__doc__, @@ -454,7 +479,11 @@ _io_FileIO_tell_impl(fileio *self); static PyObject * _io_FileIO_tell(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_FileIO_tell_impl((fileio *)self); + PyObject *return_value = NULL; + + return_value = _io_FileIO_tell_impl((fileio *)self); + + return return_value; } #if defined(HAVE_FTRUNCATE) @@ -527,10 +556,14 @@ _io_FileIO_isatty_impl(fileio *self); static PyObject * _io_FileIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_FileIO_isatty_impl((fileio *)self); + PyObject *return_value = NULL; + + return_value = _io_FileIO_isatty_impl((fileio *)self); + + return return_value; } #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=dcbeb6a0b13e4b1f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b247cc05968891b2 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/stringio.c.h b/Modules/_io/clinic/stringio.c.h index bc571698806bde..2c5757f668e93d 100644 --- a/Modules/_io/clinic/stringio.c.h +++ b/Modules/_io/clinic/stringio.c.h @@ -247,7 +247,7 @@ static PyObject * _io_StringIO_write_impl(stringio *self, PyObject *obj); static PyObject * -_io_StringIO_write(stringio *self, PyObject *obj) +_io_StringIO_write(PyObject *self, PyObject *obj) { PyObject *return_value = NULL; @@ -465,7 +465,7 @@ static PyObject * _io_StringIO___setstate___impl(stringio *self, PyObject *state); static PyObject * -_io_StringIO___setstate__(stringio *self, PyObject *state) +_io_StringIO___setstate__(PyObject *self, PyObject *state) { PyObject *return_value = NULL; @@ -550,4 +550,4 @@ _io_StringIO_newlines_get(PyObject *self, void *Py_UNUSED(context)) return return_value; } -/*[clinic end generated code: output=7796e223e778a214 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=69c9b100a359cbd5 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index 9ce1d70ad71052..9be58de9aa732f 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -446,7 +446,11 @@ _io_IncrementalNewlineDecoder_getstate_impl(nldecoder_object *self); static PyObject * _io_IncrementalNewlineDecoder_getstate(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_IncrementalNewlineDecoder_getstate_impl((nldecoder_object *)self); + PyObject *return_value = NULL; + + return_value = _io_IncrementalNewlineDecoder_getstate_impl((nldecoder_object *)self); + + return return_value; } PyDoc_STRVAR(_io_IncrementalNewlineDecoder_setstate__doc__, @@ -457,6 +461,20 @@ PyDoc_STRVAR(_io_IncrementalNewlineDecoder_setstate__doc__, #define _IO_INCREMENTALNEWLINEDECODER_SETSTATE_METHODDEF \ {"setstate", (PyCFunction)_io_IncrementalNewlineDecoder_setstate, METH_O, _io_IncrementalNewlineDecoder_setstate__doc__}, +static PyObject * +_io_IncrementalNewlineDecoder_setstate_impl(nldecoder_object *self, + PyObject *state); + +static PyObject * +_io_IncrementalNewlineDecoder_setstate(PyObject *self, PyObject *state) +{ + PyObject *return_value = NULL; + + return_value = _io_IncrementalNewlineDecoder_setstate_impl((nldecoder_object *)self, state); + + return return_value; +} + PyDoc_STRVAR(_io_IncrementalNewlineDecoder_reset__doc__, "reset($self, /)\n" "--\n" @@ -471,7 +489,11 @@ _io_IncrementalNewlineDecoder_reset_impl(nldecoder_object *self); static PyObject * _io_IncrementalNewlineDecoder_reset(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io_IncrementalNewlineDecoder_reset_impl((nldecoder_object *)self); + PyObject *return_value = NULL; + + return_value = _io_IncrementalNewlineDecoder_reset_impl((nldecoder_object *)self); + + return return_value; } PyDoc_STRVAR(_io_TextIOWrapper___init____doc__, @@ -1290,4 +1312,4 @@ _io_TextIOWrapper__CHUNK_SIZE_set(PyObject *self, PyObject *value, void *Py_UNUS return return_value; } -/*[clinic end generated code: output=6e64e43113a97340 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=83429aa3b618a83d input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h index ba6dcde6e01064..95f4757cbe39b3 100644 --- a/Modules/_io/clinic/winconsoleio.c.h +++ b/Modules/_io/clinic/winconsoleio.c.h @@ -29,11 +29,16 @@ _io__WindowsConsoleIO_close_impl(winconsoleio *self, PyTypeObject *cls); static PyObject * _io__WindowsConsoleIO_close(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "close() takes no arguments"); - return NULL; + goto exit; } - return _io__WindowsConsoleIO_close_impl((winconsoleio *)self, cls); + return_value = _io__WindowsConsoleIO_close_impl((winconsoleio *)self, cls); + +exit: + return return_value; } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -156,7 +161,11 @@ _io__WindowsConsoleIO_fileno_impl(winconsoleio *self); static PyObject * _io__WindowsConsoleIO_fileno(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io__WindowsConsoleIO_fileno_impl((winconsoleio *)self); + PyObject *return_value = NULL; + + return_value = _io__WindowsConsoleIO_fileno_impl((winconsoleio *)self); + + return return_value; } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -178,7 +187,11 @@ _io__WindowsConsoleIO_readable_impl(winconsoleio *self); static PyObject * _io__WindowsConsoleIO_readable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io__WindowsConsoleIO_readable_impl((winconsoleio *)self); + PyObject *return_value = NULL; + + return_value = _io__WindowsConsoleIO_readable_impl((winconsoleio *)self); + + return return_value; } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -200,7 +213,11 @@ _io__WindowsConsoleIO_writable_impl(winconsoleio *self); static PyObject * _io__WindowsConsoleIO_writable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io__WindowsConsoleIO_writable_impl((winconsoleio *)self); + PyObject *return_value = NULL; + + return_value = _io__WindowsConsoleIO_writable_impl((winconsoleio *)self); + + return return_value; } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -281,7 +298,11 @@ _io__WindowsConsoleIO_readall_impl(winconsoleio *self); static PyObject * _io__WindowsConsoleIO_readall(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io__WindowsConsoleIO_readall_impl((winconsoleio *)self); + PyObject *return_value = NULL; + + return_value = _io__WindowsConsoleIO_readall_impl((winconsoleio *)self); + + return return_value; } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -421,7 +442,11 @@ _io__WindowsConsoleIO_isatty_impl(winconsoleio *self); static PyObject * _io__WindowsConsoleIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _io__WindowsConsoleIO_isatty_impl((winconsoleio *)self); + PyObject *return_value = NULL; + + return_value = _io__WindowsConsoleIO_isatty_impl((winconsoleio *)self); + + return return_value; } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -461,4 +486,4 @@ _io__WindowsConsoleIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=edc47f5c49589045 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=df1b04a95695734c input=a9049054013a1b77]*/ diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 935aaab20a031f..969eac8f85352c 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -579,9 +579,9 @@ _io.IncrementalNewlineDecoder.setstate [clinic start generated code]*/ static PyObject * -_io_IncrementalNewlineDecoder_setstate(nldecoder_object *self, - PyObject *state) -/*[clinic end generated code: output=c10c622508b576cb input=c53fb505a76dbbe2]*/ +_io_IncrementalNewlineDecoder_setstate_impl(nldecoder_object *self, + PyObject *state) +/*[clinic end generated code: output=09135cb6e78a1dc8 input=c53fb505a76dbbe2]*/ { PyObject *buffer; unsigned long long flag; diff --git a/Modules/_multiprocessing/clinic/semaphore.c.h b/Modules/_multiprocessing/clinic/semaphore.c.h index e789137ec1e013..e6382e4b56cae3 100644 --- a/Modules/_multiprocessing/clinic/semaphore.c.h +++ b/Modules/_multiprocessing/clinic/semaphore.c.h @@ -388,7 +388,11 @@ _multiprocessing_SemLock__is_mine_impl(SemLockObject *self); static PyObject * _multiprocessing_SemLock__is_mine(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _multiprocessing_SemLock__is_mine_impl((SemLockObject *)self); + PyObject *return_value = NULL; + + return_value = _multiprocessing_SemLock__is_mine_impl((SemLockObject *)self); + + return return_value; } #endif /* defined(HAVE_MP_SEMAPHORE) */ @@ -410,7 +414,11 @@ _multiprocessing_SemLock__get_value_impl(SemLockObject *self); static PyObject * _multiprocessing_SemLock__get_value(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _multiprocessing_SemLock__get_value_impl((SemLockObject *)self); + PyObject *return_value = NULL; + + return_value = _multiprocessing_SemLock__get_value_impl((SemLockObject *)self); + + return return_value; } #endif /* defined(HAVE_MP_SEMAPHORE) */ @@ -432,7 +440,11 @@ _multiprocessing_SemLock__is_zero_impl(SemLockObject *self); static PyObject * _multiprocessing_SemLock__is_zero(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _multiprocessing_SemLock__is_zero_impl((SemLockObject *)self); + PyObject *return_value = NULL; + + return_value = _multiprocessing_SemLock__is_zero_impl((SemLockObject *)self); + + return return_value; } #endif /* defined(HAVE_MP_SEMAPHORE) */ @@ -454,7 +466,11 @@ _multiprocessing_SemLock__after_fork_impl(SemLockObject *self); static PyObject * _multiprocessing_SemLock__after_fork(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _multiprocessing_SemLock__after_fork_impl((SemLockObject *)self); + PyObject *return_value = NULL; + + return_value = _multiprocessing_SemLock__after_fork_impl((SemLockObject *)self); + + return return_value; } #endif /* defined(HAVE_MP_SEMAPHORE) */ @@ -576,4 +592,4 @@ _multiprocessing_SemLock___exit__(PyObject *self, PyObject *const *args, Py_ssiz #ifndef _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF #define _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF #endif /* !defined(_MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF) */ -/*[clinic end generated code: output=e28d0fdbfefd1235 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=01e706da40883df7 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/blob.c.h b/Modules/_sqlite/clinic/blob.c.h index 921e7cbd7ffcab..01855aca6f5f46 100644 --- a/Modules/_sqlite/clinic/blob.c.h +++ b/Modules/_sqlite/clinic/blob.c.h @@ -19,7 +19,11 @@ blob_close_impl(pysqlite_Blob *self); static PyObject * blob_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return blob_close_impl((pysqlite_Blob *)self); + PyObject *return_value = NULL; + + return_value = blob_close_impl((pysqlite_Blob *)self); + + return return_value; } PyDoc_STRVAR(blob_read__doc__, @@ -158,7 +162,11 @@ blob_tell_impl(pysqlite_Blob *self); static PyObject * blob_tell(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return blob_tell_impl((pysqlite_Blob *)self); + PyObject *return_value = NULL; + + return_value = blob_tell_impl((pysqlite_Blob *)self); + + return return_value; } PyDoc_STRVAR(blob_enter__doc__, @@ -176,7 +184,11 @@ blob_enter_impl(pysqlite_Blob *self); static PyObject * blob_enter(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return blob_enter_impl((pysqlite_Blob *)self); + PyObject *return_value = NULL; + + return_value = blob_enter_impl((pysqlite_Blob *)self); + + return return_value; } PyDoc_STRVAR(blob_exit__doc__, @@ -211,4 +223,4 @@ blob_exit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=f03f4ba622b67ae0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b7553a77a3f36b31 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/connection.c.h b/Modules/_sqlite/clinic/connection.c.h index 82fba44eb1b074..b3590054f2c2b7 100644 --- a/Modules/_sqlite/clinic/connection.c.h +++ b/Modules/_sqlite/clinic/connection.c.h @@ -374,7 +374,11 @@ pysqlite_connection_close_impl(pysqlite_Connection *self); static PyObject * pysqlite_connection_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pysqlite_connection_close_impl((pysqlite_Connection *)self); + PyObject *return_value = NULL; + + return_value = pysqlite_connection_close_impl((pysqlite_Connection *)self); + + return return_value; } PyDoc_STRVAR(pysqlite_connection_commit__doc__, @@ -394,7 +398,11 @@ pysqlite_connection_commit_impl(pysqlite_Connection *self); static PyObject * pysqlite_connection_commit(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pysqlite_connection_commit_impl((pysqlite_Connection *)self); + PyObject *return_value = NULL; + + return_value = pysqlite_connection_commit_impl((pysqlite_Connection *)self); + + return return_value; } PyDoc_STRVAR(pysqlite_connection_rollback__doc__, @@ -414,7 +422,11 @@ pysqlite_connection_rollback_impl(pysqlite_Connection *self); static PyObject * pysqlite_connection_rollback(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pysqlite_connection_rollback_impl((pysqlite_Connection *)self); + PyObject *return_value = NULL; + + return_value = pysqlite_connection_rollback_impl((pysqlite_Connection *)self); + + return return_value; } PyDoc_STRVAR(pysqlite_connection_create_function__doc__, @@ -1195,6 +1207,20 @@ PyDoc_STRVAR(pysqlite_connection_executescript__doc__, #define PYSQLITE_CONNECTION_EXECUTESCRIPT_METHODDEF \ {"executescript", (PyCFunction)pysqlite_connection_executescript, METH_O, pysqlite_connection_executescript__doc__}, +static PyObject * +pysqlite_connection_executescript_impl(pysqlite_Connection *self, + PyObject *script_obj); + +static PyObject * +pysqlite_connection_executescript(PyObject *self, PyObject *script_obj) +{ + PyObject *return_value = NULL; + + return_value = pysqlite_connection_executescript_impl((pysqlite_Connection *)self, script_obj); + + return return_value; +} + PyDoc_STRVAR(pysqlite_connection_interrupt__doc__, "interrupt($self, /)\n" "--\n" @@ -1210,7 +1236,11 @@ pysqlite_connection_interrupt_impl(pysqlite_Connection *self); static PyObject * pysqlite_connection_interrupt(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pysqlite_connection_interrupt_impl((pysqlite_Connection *)self); + PyObject *return_value = NULL; + + return_value = pysqlite_connection_interrupt_impl((pysqlite_Connection *)self); + + return return_value; } PyDoc_STRVAR(pysqlite_connection_iterdump__doc__, @@ -1668,7 +1698,11 @@ pysqlite_connection_enter_impl(pysqlite_Connection *self); static PyObject * pysqlite_connection_enter(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pysqlite_connection_enter_impl((pysqlite_Connection *)self); + PyObject *return_value = NULL; + + return_value = pysqlite_connection_enter_impl((pysqlite_Connection *)self); + + return return_value; } PyDoc_STRVAR(pysqlite_connection_exit__doc__, @@ -1881,4 +1915,4 @@ getconfig(PyObject *self, PyObject *arg) #ifndef DESERIALIZE_METHODDEF #define DESERIALIZE_METHODDEF #endif /* !defined(DESERIALIZE_METHODDEF) */ -/*[clinic end generated code: output=c59effb407b8ea4d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c518b3e5ebe4b9b9 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/cursor.c.h b/Modules/_sqlite/clinic/cursor.c.h index 590e429e9139f1..59ed8325fa8340 100644 --- a/Modules/_sqlite/clinic/cursor.c.h +++ b/Modules/_sqlite/clinic/cursor.c.h @@ -165,7 +165,11 @@ pysqlite_cursor_fetchone_impl(pysqlite_Cursor *self); static PyObject * pysqlite_cursor_fetchone(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pysqlite_cursor_fetchone_impl((pysqlite_Cursor *)self); + PyObject *return_value = NULL; + + return_value = pysqlite_cursor_fetchone_impl((pysqlite_Cursor *)self); + + return return_value; } PyDoc_STRVAR(pysqlite_cursor_fetchmany__doc__, @@ -250,7 +254,11 @@ pysqlite_cursor_fetchall_impl(pysqlite_Cursor *self); static PyObject * pysqlite_cursor_fetchall(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pysqlite_cursor_fetchall_impl((pysqlite_Cursor *)self); + PyObject *return_value = NULL; + + return_value = pysqlite_cursor_fetchall_impl((pysqlite_Cursor *)self); + + return return_value; } PyDoc_STRVAR(pysqlite_cursor_setinputsizes__doc__, @@ -262,6 +270,19 @@ PyDoc_STRVAR(pysqlite_cursor_setinputsizes__doc__, #define PYSQLITE_CURSOR_SETINPUTSIZES_METHODDEF \ {"setinputsizes", (PyCFunction)pysqlite_cursor_setinputsizes, METH_O, pysqlite_cursor_setinputsizes__doc__}, +static PyObject * +pysqlite_cursor_setinputsizes_impl(pysqlite_Cursor *self, PyObject *sizes); + +static PyObject * +pysqlite_cursor_setinputsizes(PyObject *self, PyObject *sizes) +{ + PyObject *return_value = NULL; + + return_value = pysqlite_cursor_setinputsizes_impl((pysqlite_Cursor *)self, sizes); + + return return_value; +} + PyDoc_STRVAR(pysqlite_cursor_setoutputsize__doc__, "setoutputsize($self, size, column=None, /)\n" "--\n" @@ -312,6 +333,10 @@ pysqlite_cursor_close_impl(pysqlite_Cursor *self); static PyObject * pysqlite_cursor_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pysqlite_cursor_close_impl((pysqlite_Cursor *)self); + PyObject *return_value = NULL; + + return_value = pysqlite_cursor_close_impl((pysqlite_Cursor *)self); + + return return_value; } -/*[clinic end generated code: output=82620ca7622b547c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ad3519acb068dcaf input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/row.c.h b/Modules/_sqlite/clinic/row.c.h index 068906744e445f..c72f3552ddd7f9 100644 --- a/Modules/_sqlite/clinic/row.c.h +++ b/Modules/_sqlite/clinic/row.c.h @@ -54,6 +54,10 @@ pysqlite_row_keys_impl(pysqlite_Row *self); static PyObject * pysqlite_row_keys(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pysqlite_row_keys_impl((pysqlite_Row *)self); + PyObject *return_value = NULL; + + return_value = pysqlite_row_keys_impl((pysqlite_Row *)self); + + return return_value; } -/*[clinic end generated code: output=6c1acbb48f386468 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6d348877c833b604 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 7997e5f4d986f3..13bc0b9199c4c4 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -1908,9 +1908,9 @@ Executes multiple SQL statements at once. [clinic start generated code]*/ static PyObject * -pysqlite_connection_executescript(pysqlite_Connection *self, - PyObject *script_obj) -/*[clinic end generated code: output=4c4f9d77aa0ae37d input=f6e5f1ccfa313db4]*/ +pysqlite_connection_executescript_impl(pysqlite_Connection *self, + PyObject *script_obj) +/*[clinic end generated code: output=e921c49e2291782c input=f6e5f1ccfa313db4]*/ { PyObject* result = 0; diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index ad3587d88dd854..7943bfcca3679d 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -1243,8 +1243,8 @@ Required by DB-API. Does nothing in sqlite3. [clinic start generated code]*/ static PyObject * -pysqlite_cursor_setinputsizes(pysqlite_Cursor *self, PyObject *sizes) -/*[clinic end generated code: output=893c817afe9d08ad input=de7950a3aec79bdf]*/ +pysqlite_cursor_setinputsizes_impl(pysqlite_Cursor *self, PyObject *sizes) +/*[clinic end generated code: output=a06c12790bd05f2e input=de7950a3aec79bdf]*/ { Py_RETURN_NONE; } diff --git a/Modules/_sre/clinic/sre.c.h b/Modules/_sre/clinic/sre.c.h index cfc6813f37f012..c0db1cb5b1a740 100644 --- a/Modules/_sre/clinic/sre.c.h +++ b/Modules/_sre/clinic/sre.c.h @@ -974,7 +974,11 @@ _sre_SRE_Pattern___copy___impl(PatternObject *self); static PyObject * _sre_SRE_Pattern___copy__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _sre_SRE_Pattern___copy___impl((PatternObject *)self); + PyObject *return_value = NULL; + + return_value = _sre_SRE_Pattern___copy___impl((PatternObject *)self); + + return return_value; } PyDoc_STRVAR(_sre_SRE_Pattern___deepcopy____doc__, @@ -985,6 +989,19 @@ PyDoc_STRVAR(_sre_SRE_Pattern___deepcopy____doc__, #define _SRE_SRE_PATTERN___DEEPCOPY___METHODDEF \ {"__deepcopy__", (PyCFunction)_sre_SRE_Pattern___deepcopy__, METH_O, _sre_SRE_Pattern___deepcopy____doc__}, +static PyObject * +_sre_SRE_Pattern___deepcopy___impl(PatternObject *self, PyObject *memo); + +static PyObject * +_sre_SRE_Pattern___deepcopy__(PyObject *self, PyObject *memo) +{ + PyObject *return_value = NULL; + + return_value = _sre_SRE_Pattern___deepcopy___impl((PatternObject *)self, memo); + + return return_value; +} + #if defined(Py_DEBUG) PyDoc_STRVAR(_sre_SRE_Pattern__fail_after__doc__, @@ -1460,7 +1477,11 @@ _sre_SRE_Match___copy___impl(MatchObject *self); static PyObject * _sre_SRE_Match___copy__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _sre_SRE_Match___copy___impl((MatchObject *)self); + PyObject *return_value = NULL; + + return_value = _sre_SRE_Match___copy___impl((MatchObject *)self); + + return return_value; } PyDoc_STRVAR(_sre_SRE_Match___deepcopy____doc__, @@ -1471,6 +1492,19 @@ PyDoc_STRVAR(_sre_SRE_Match___deepcopy____doc__, #define _SRE_SRE_MATCH___DEEPCOPY___METHODDEF \ {"__deepcopy__", (PyCFunction)_sre_SRE_Match___deepcopy__, METH_O, _sre_SRE_Match___deepcopy____doc__}, +static PyObject * +_sre_SRE_Match___deepcopy___impl(MatchObject *self, PyObject *memo); + +static PyObject * +_sre_SRE_Match___deepcopy__(PyObject *self, PyObject *memo) +{ + PyObject *return_value = NULL; + + return_value = _sre_SRE_Match___deepcopy___impl((MatchObject *)self, memo); + + return return_value; +} + PyDoc_STRVAR(_sre_SRE_Scanner_match__doc__, "match($self, /)\n" "--\n" @@ -1485,11 +1519,16 @@ _sre_SRE_Scanner_match_impl(ScannerObject *self, PyTypeObject *cls); static PyObject * _sre_SRE_Scanner_match(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "match() takes no arguments"); - return NULL; + goto exit; } - return _sre_SRE_Scanner_match_impl((ScannerObject *)self, cls); + return_value = _sre_SRE_Scanner_match_impl((ScannerObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_sre_SRE_Scanner_search__doc__, @@ -1506,14 +1545,19 @@ _sre_SRE_Scanner_search_impl(ScannerObject *self, PyTypeObject *cls); static PyObject * _sre_SRE_Scanner_search(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "search() takes no arguments"); - return NULL; + goto exit; } - return _sre_SRE_Scanner_search_impl((ScannerObject *)self, cls); + return_value = _sre_SRE_Scanner_search_impl((ScannerObject *)self, cls); + +exit: + return return_value; } #ifndef _SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF #define _SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF #endif /* !defined(_SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF) */ -/*[clinic end generated code: output=3654103c87eb4830 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e3189955b9a16cf3 input=a9049054013a1b77]*/ diff --git a/Modules/_sre/sre.c b/Modules/_sre/sre.c index 54f0e64d4819f1..1c0e44c933a7bf 100644 --- a/Modules/_sre/sre.c +++ b/Modules/_sre/sre.c @@ -1482,8 +1482,8 @@ _sre.SRE_Pattern.__deepcopy__ [clinic start generated code]*/ static PyObject * -_sre_SRE_Pattern___deepcopy__(PatternObject *self, PyObject *memo) -/*[clinic end generated code: output=2ad25679c1f1204a input=a465b1602f997bed]*/ +_sre_SRE_Pattern___deepcopy___impl(PatternObject *self, PyObject *memo) +/*[clinic end generated code: output=75efe69bd12c5d7d input=a465b1602f997bed]*/ { return Py_NewRef(self); } @@ -2659,8 +2659,8 @@ _sre.SRE_Match.__deepcopy__ [clinic start generated code]*/ static PyObject * -_sre_SRE_Match___deepcopy__(MatchObject *self, PyObject *memo) -/*[clinic end generated code: output=ba7cb46d655e4ee2 input=779d12a31c2c325e]*/ +_sre_SRE_Match___deepcopy___impl(MatchObject *self, PyObject *memo) +/*[clinic end generated code: output=2b657578eb03f4a3 input=779d12a31c2c325e]*/ { return Py_NewRef(self); } diff --git a/Modules/_ssl/clinic/cert.c.h b/Modules/_ssl/clinic/cert.c.h index 3e0c5b405092db..d4b7070847d864 100644 --- a/Modules/_ssl/clinic/cert.c.h +++ b/Modules/_ssl/clinic/cert.c.h @@ -85,6 +85,10 @@ _ssl_Certificate_get_info_impl(PySSLCertificate *self); static PyObject * _ssl_Certificate_get_info(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _ssl_Certificate_get_info_impl((PySSLCertificate *)self); + PyObject *return_value = NULL; + + return_value = _ssl_Certificate_get_info_impl((PySSLCertificate *)self); + + return return_value; } -/*[clinic end generated code: output=51365b498b975ee0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9de85ca49784b7a1 input=a9049054013a1b77]*/ diff --git a/Modules/_struct.c b/Modules/_struct.c index f096998cb714e7..0be71905d277ee 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -2131,8 +2131,8 @@ Requires that the bytes length be a multiple of the struct size. [clinic start generated code]*/ static PyObject * -Struct_iter_unpack(PyStructObject *self, PyObject *buffer) -/*[clinic end generated code: output=172d83d0cd15dbab input=6d65b3f3107dbc99]*/ +Struct_iter_unpack_impl(PyStructObject *self, PyObject *buffer) +/*[clinic end generated code: output=818f89ad4afa8d64 input=6d65b3f3107dbc99]*/ { _structmodulestate *state = get_struct_state_structinst(self); unpackiterobject *iter; diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 3351a778c42cf5..c7cc3a8071dc1c 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -2010,8 +2010,8 @@ _tkinter.tkapp.getint [clinic start generated code]*/ static PyObject * -_tkinter_tkapp_getint(TkappObject *self, PyObject *arg) -/*[clinic end generated code: output=88cf293fae307cfe input=034026997c5b91f8]*/ +_tkinter_tkapp_getint_impl(TkappObject *self, PyObject *arg) +/*[clinic end generated code: output=5f75d31b260d4086 input=034026997c5b91f8]*/ { char *s; Tcl_Obj *value; @@ -2055,8 +2055,8 @@ _tkinter.tkapp.getdouble [clinic start generated code]*/ static PyObject * -_tkinter_tkapp_getdouble(TkappObject *self, PyObject *arg) -/*[clinic end generated code: output=c52b138bd8b956b9 input=22015729ce9ef7f8]*/ +_tkinter_tkapp_getdouble_impl(TkappObject *self, PyObject *arg) +/*[clinic end generated code: output=432433f2f52b09b6 input=22015729ce9ef7f8]*/ { char *s; double v; @@ -2094,8 +2094,8 @@ _tkinter.tkapp.getboolean [clinic start generated code]*/ static PyObject * -_tkinter_tkapp_getboolean(TkappObject *self, PyObject *arg) -/*[clinic end generated code: output=726a9ae445821d91 input=7f11248ef8f8776e]*/ +_tkinter_tkapp_getboolean_impl(TkappObject *self, PyObject *arg) +/*[clinic end generated code: output=3b05597cf2bfbd9f input=7f11248ef8f8776e]*/ { char *s; int v; @@ -2258,8 +2258,8 @@ _tkinter.tkapp.splitlist [clinic start generated code]*/ static PyObject * -_tkinter_tkapp_splitlist(TkappObject *self, PyObject *arg) -/*[clinic end generated code: output=13b51d34386d36fb input=2b2e13351e3c0b53]*/ +_tkinter_tkapp_splitlist_impl(TkappObject *self, PyObject *arg) +/*[clinic end generated code: output=e517f462159c3000 input=2b2e13351e3c0b53]*/ { char *list; Tcl_Size argc, i; @@ -2676,8 +2676,8 @@ _tkinter.tkapp.deletefilehandler [clinic start generated code]*/ static PyObject * -_tkinter_tkapp_deletefilehandler(TkappObject *self, PyObject *file) -/*[clinic end generated code: output=b53cc96ebf9476fd input=abbec19d66312e2a]*/ +_tkinter_tkapp_deletefilehandler_impl(TkappObject *self, PyObject *file) +/*[clinic end generated code: output=30b2c6ed195b0410 input=abbec19d66312e2a]*/ { int tfile; @@ -3010,8 +3010,8 @@ Set the tracing function. [clinic start generated code]*/ static PyObject * -_tkinter_tkapp_settrace(TkappObject *self, PyObject *func) -/*[clinic end generated code: output=847f6ebdf46e84fa input=31b260d46d3d018a]*/ +_tkinter_tkapp_settrace_impl(TkappObject *self, PyObject *func) +/*[clinic end generated code: output=8c59938bc9005607 input=31b260d46d3d018a]*/ { if (func == Py_None) { func = NULL; diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 0775b26e1d68ed..002c0938accb28 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -3319,8 +3319,8 @@ Set state information for unpickling. [clinic start generated code]*/ static PyObject * -array_arrayiterator___setstate__(arrayiterobject *self, PyObject *state) -/*[clinic end generated code: output=397da9904e443cbe input=f47d5ceda19e787b]*/ +array_arrayiterator___setstate___impl(arrayiterobject *self, PyObject *state) +/*[clinic end generated code: output=d7837ae4ac1fd8b9 input=f47d5ceda19e787b]*/ { Py_ssize_t index = PyLong_AsSsize_t(state); if (index == -1 && PyErr_Occurred()) { diff --git a/Modules/blake2module.c b/Modules/blake2module.c index 016c834c01bbe2..f55d93a3066025 100644 --- a/Modules/blake2module.c +++ b/Modules/blake2module.c @@ -739,8 +739,8 @@ Update this hash object's state with the provided bytes-like object. [clinic start generated code]*/ static PyObject * -_blake2_blake2b_update(Blake2Object *self, PyObject *data) -/*[clinic end generated code: output=e6d1ac88471df308 input=ffc4aa6a6a225d31]*/ +_blake2_blake2b_update_impl(Blake2Object *self, PyObject *data) +/*[clinic end generated code: output=99330230068e8c99 input=ffc4aa6a6a225d31]*/ { Py_buffer buf; diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index d77bbd48066354..25a47e6f7ce7dc 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -270,7 +270,11 @@ _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEn static PyObject * _multibytecodec_MultibyteIncrementalEncoder_getstate(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _multibytecodec_MultibyteIncrementalEncoder_getstate_impl((MultibyteIncrementalEncoderObject *)self); + PyObject *return_value = NULL; + + return_value = _multibytecodec_MultibyteIncrementalEncoder_getstate_impl((MultibyteIncrementalEncoderObject *)self); + + return return_value; } PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_setstate__doc__, @@ -316,7 +320,11 @@ _multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncod static PyObject * _multibytecodec_MultibyteIncrementalEncoder_reset(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _multibytecodec_MultibyteIncrementalEncoder_reset_impl((MultibyteIncrementalEncoderObject *)self); + PyObject *return_value = NULL; + + return_value = _multibytecodec_MultibyteIncrementalEncoder_reset_impl((MultibyteIncrementalEncoderObject *)self); + + return return_value; } PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_decode__doc__, @@ -407,7 +415,11 @@ _multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDe static PyObject * _multibytecodec_MultibyteIncrementalDecoder_getstate(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _multibytecodec_MultibyteIncrementalDecoder_getstate_impl((MultibyteIncrementalDecoderObject *)self); + PyObject *return_value = NULL; + + return_value = _multibytecodec_MultibyteIncrementalDecoder_getstate_impl((MultibyteIncrementalDecoderObject *)self); + + return return_value; } PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_setstate__doc__, @@ -453,7 +465,11 @@ _multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecod static PyObject * _multibytecodec_MultibyteIncrementalDecoder_reset(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _multibytecodec_MultibyteIncrementalDecoder_reset_impl((MultibyteIncrementalDecoderObject *)self); + PyObject *return_value = NULL; + + return_value = _multibytecodec_MultibyteIncrementalDecoder_reset_impl((MultibyteIncrementalDecoderObject *)self); + + return return_value; } PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__, @@ -566,7 +582,11 @@ _multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *se static PyObject * _multibytecodec_MultibyteStreamReader_reset(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _multibytecodec_MultibyteStreamReader_reset_impl((MultibyteStreamReaderObject *)self); + PyObject *return_value = NULL; + + return_value = _multibytecodec_MultibyteStreamReader_reset_impl((MultibyteStreamReaderObject *)self); + + return return_value; } PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_write__doc__, @@ -674,11 +694,16 @@ _multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *se static PyObject * _multibytecodec_MultibyteStreamWriter_reset(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "reset() takes no arguments"); - return NULL; + goto exit; } - return _multibytecodec_MultibyteStreamWriter_reset_impl((MultibyteStreamWriterObject *)self, cls); + return_value = _multibytecodec_MultibyteStreamWriter_reset_impl((MultibyteStreamWriterObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_multibytecodec___create_codec__doc__, @@ -688,4 +713,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=6571941b8e45b013 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=54c020a95ab3de66 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_asynciomodule.c.h b/Modules/clinic/_asynciomodule.c.h index d25411ee9958a1..2f38445c93ca11 100644 --- a/Modules/clinic/_asynciomodule.c.h +++ b/Modules/clinic/_asynciomodule.c.h @@ -1403,6 +1403,19 @@ PyDoc_STRVAR(_asyncio_Task_set_result__doc__, #define _ASYNCIO_TASK_SET_RESULT_METHODDEF \ {"set_result", (PyCFunction)_asyncio_Task_set_result, METH_O, _asyncio_Task_set_result__doc__}, +static PyObject * +_asyncio_Task_set_result_impl(TaskObj *self, PyObject *result); + +static PyObject * +_asyncio_Task_set_result(PyObject *self, PyObject *result) +{ + PyObject *return_value = NULL; + + return_value = _asyncio_Task_set_result_impl((TaskObj *)self, result); + + return return_value; +} + PyDoc_STRVAR(_asyncio_Task_set_exception__doc__, "set_exception($self, exception, /)\n" "--\n" @@ -1411,6 +1424,19 @@ PyDoc_STRVAR(_asyncio_Task_set_exception__doc__, #define _ASYNCIO_TASK_SET_EXCEPTION_METHODDEF \ {"set_exception", (PyCFunction)_asyncio_Task_set_exception, METH_O, _asyncio_Task_set_exception__doc__}, +static PyObject * +_asyncio_Task_set_exception_impl(TaskObj *self, PyObject *exception); + +static PyObject * +_asyncio_Task_set_exception(PyObject *self, PyObject *exception) +{ + PyObject *return_value = NULL; + + return_value = _asyncio_Task_set_exception_impl((TaskObj *)self, exception); + + return return_value; +} + PyDoc_STRVAR(_asyncio_Task_get_coro__doc__, "get_coro($self, /)\n" "--\n" @@ -1448,7 +1474,11 @@ _asyncio_Task_get_context_impl(TaskObj *self); static PyObject * _asyncio_Task_get_context(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _asyncio_Task_get_context_impl((TaskObj *)self); + PyObject *return_value = NULL; + + return_value = _asyncio_Task_get_context_impl((TaskObj *)self); + + return return_value; } PyDoc_STRVAR(_asyncio_Task_get_name__doc__, @@ -1486,7 +1516,7 @@ static PyObject * _asyncio_Task_set_name_impl(TaskObj *self, PyObject *value); static PyObject * -_asyncio_Task_set_name(TaskObj *self, PyObject *value) +_asyncio_Task_set_name(PyObject *self, PyObject *value) { PyObject *return_value = NULL; @@ -2174,4 +2204,4 @@ _asyncio_future_discard_from_awaited_by(PyObject *module, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=f14ff14c29c691ec input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f186505df0f9da89 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index a599bd1a8be96a..bc9a33e4fca0fb 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -65,7 +65,11 @@ _bz2_BZ2Compressor_flush_impl(BZ2Compressor *self); static PyObject * _bz2_BZ2Compressor_flush(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _bz2_BZ2Compressor_flush_impl((BZ2Compressor *)self); + PyObject *return_value = NULL; + + return_value = _bz2_BZ2Compressor_flush_impl((BZ2Compressor *)self); + + return return_value; } PyDoc_STRVAR(_bz2_BZ2Compressor__doc__, @@ -235,4 +239,4 @@ _bz2_BZ2Decompressor(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=0fc5a6292c5fd2c5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1fde2ac12ffe85a3 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_collectionsmodule.c.h b/Modules/clinic/_collectionsmodule.c.h index ddf18c2c77a8cd..c543c4310c804c 100644 --- a/Modules/clinic/_collectionsmodule.c.h +++ b/Modules/clinic/_collectionsmodule.c.h @@ -71,7 +71,7 @@ static PyObject * deque_append_impl(dequeobject *deque, PyObject *item); static PyObject * -deque_append(dequeobject *deque, PyObject *item) +deque_append(PyObject *deque, PyObject *item) { PyObject *return_value = NULL; @@ -95,7 +95,7 @@ static PyObject * deque_appendleft_impl(dequeobject *deque, PyObject *item); static PyObject * -deque_appendleft(dequeobject *deque, PyObject *item) +deque_appendleft(PyObject *deque, PyObject *item) { PyObject *return_value = NULL; @@ -119,7 +119,7 @@ static PyObject * deque_extend_impl(dequeobject *deque, PyObject *iterable); static PyObject * -deque_extend(dequeobject *deque, PyObject *iterable) +deque_extend(PyObject *deque, PyObject *iterable) { PyObject *return_value = NULL; @@ -143,7 +143,7 @@ static PyObject * deque_extendleft_impl(dequeobject *deque, PyObject *iterable); static PyObject * -deque_extendleft(dequeobject *deque, PyObject *iterable) +deque_extendleft(PyObject *deque, PyObject *iterable) { PyObject *return_value = NULL; @@ -308,7 +308,7 @@ static PyObject * deque_count_impl(dequeobject *deque, PyObject *v); static PyObject * -deque_count(dequeobject *deque, PyObject *v) +deque_count(PyObject *deque, PyObject *v) { PyObject *return_value = NULL; @@ -423,7 +423,7 @@ static PyObject * deque_remove_impl(dequeobject *deque, PyObject *value); static PyObject * -deque_remove(dequeobject *deque, PyObject *value) +deque_remove(PyObject *deque, PyObject *value) { PyObject *return_value = NULL; @@ -449,7 +449,11 @@ deque___reduce___impl(dequeobject *deque); static PyObject * deque___reduce__(PyObject *deque, PyObject *Py_UNUSED(ignored)) { - return deque___reduce___impl((dequeobject *)deque); + PyObject *return_value = NULL; + + return_value = deque___reduce___impl((dequeobject *)deque); + + return return_value; } PyDoc_STRVAR(deque_init__doc__, @@ -560,7 +564,11 @@ deque___reversed___impl(dequeobject *deque); static PyObject * deque___reversed__(PyObject *deque, PyObject *Py_UNUSED(ignored)) { - return deque___reversed___impl((dequeobject *)deque); + PyObject *return_value = NULL; + + return_value = deque___reversed___impl((dequeobject *)deque); + + return return_value; } PyDoc_STRVAR(_collections__count_elements__doc__, @@ -630,4 +638,4 @@ tuplegetter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=2d89c39288fc7389 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=509297265c703000 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_curses_panel.c.h b/Modules/clinic/_curses_panel.c.h index 6f4966825ec4bf..e4b4994eb6eb38 100644 --- a/Modules/clinic/_curses_panel.c.h +++ b/Modules/clinic/_curses_panel.c.h @@ -22,11 +22,16 @@ _curses_panel_panel_bottom_impl(PyCursesPanelObject *self, PyTypeObject *cls); static PyObject * _curses_panel_panel_bottom(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "bottom() takes no arguments"); - return NULL; + goto exit; } - return _curses_panel_panel_bottom_impl((PyCursesPanelObject *)self, cls); + return_value = _curses_panel_panel_bottom_impl((PyCursesPanelObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_curses_panel_panel_hide__doc__, @@ -46,11 +51,16 @@ _curses_panel_panel_hide_impl(PyCursesPanelObject *self, PyTypeObject *cls); static PyObject * _curses_panel_panel_hide(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "hide() takes no arguments"); - return NULL; + goto exit; } - return _curses_panel_panel_hide_impl((PyCursesPanelObject *)self, cls); + return_value = _curses_panel_panel_hide_impl((PyCursesPanelObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_curses_panel_panel_show__doc__, @@ -68,11 +78,16 @@ _curses_panel_panel_show_impl(PyCursesPanelObject *self, PyTypeObject *cls); static PyObject * _curses_panel_panel_show(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "show() takes no arguments"); - return NULL; + goto exit; } - return _curses_panel_panel_show_impl((PyCursesPanelObject *)self, cls); + return_value = _curses_panel_panel_show_impl((PyCursesPanelObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_curses_panel_panel_top__doc__, @@ -90,11 +105,16 @@ _curses_panel_panel_top_impl(PyCursesPanelObject *self, PyTypeObject *cls); static PyObject * _curses_panel_panel_top(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "top() takes no arguments"); - return NULL; + goto exit; } - return _curses_panel_panel_top_impl((PyCursesPanelObject *)self, cls); + return_value = _curses_panel_panel_top_impl((PyCursesPanelObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_curses_panel_panel_above__doc__, @@ -112,7 +132,11 @@ _curses_panel_panel_above_impl(PyCursesPanelObject *self); static PyObject * _curses_panel_panel_above(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _curses_panel_panel_above_impl((PyCursesPanelObject *)self); + PyObject *return_value = NULL; + + return_value = _curses_panel_panel_above_impl((PyCursesPanelObject *)self); + + return return_value; } PyDoc_STRVAR(_curses_panel_panel_below__doc__, @@ -130,7 +154,11 @@ _curses_panel_panel_below_impl(PyCursesPanelObject *self); static PyObject * _curses_panel_panel_below(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _curses_panel_panel_below_impl((PyCursesPanelObject *)self); + PyObject *return_value = NULL; + + return_value = _curses_panel_panel_below_impl((PyCursesPanelObject *)self); + + return return_value; } PyDoc_STRVAR(_curses_panel_panel_hidden__doc__, @@ -148,7 +176,11 @@ _curses_panel_panel_hidden_impl(PyCursesPanelObject *self); static PyObject * _curses_panel_panel_hidden(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _curses_panel_panel_hidden_impl((PyCursesPanelObject *)self); + PyObject *return_value = NULL; + + return_value = _curses_panel_panel_hidden_impl((PyCursesPanelObject *)self); + + return return_value; } PyDoc_STRVAR(_curses_panel_panel_move__doc__, @@ -219,7 +251,11 @@ _curses_panel_panel_window_impl(PyCursesPanelObject *self); static PyObject * _curses_panel_panel_window(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _curses_panel_panel_window_impl((PyCursesPanelObject *)self); + PyObject *return_value = NULL; + + return_value = _curses_panel_panel_window_impl((PyCursesPanelObject *)self); + + return return_value; } PyDoc_STRVAR(_curses_panel_panel_replace__doc__, @@ -333,11 +369,16 @@ _curses_panel_panel_userptr_impl(PyCursesPanelObject *self, static PyObject * _curses_panel_panel_userptr(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "userptr() takes no arguments"); - return NULL; + goto exit; } - return _curses_panel_panel_userptr_impl((PyCursesPanelObject *)self, cls); + return_value = _curses_panel_panel_userptr_impl((PyCursesPanelObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_curses_panel_bottom_panel__doc__, @@ -424,4 +465,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _curses_panel_update_panels_impl(module); } -/*[clinic end generated code: output=36853ecb4a979814 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e8515683b1080c2f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index 8291d5d635c79d..228701b6e4e835 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -1347,7 +1347,11 @@ _curses_window_noutrefresh_impl(PyCursesWindowObject *self); static PyObject * _curses_window_noutrefresh(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _curses_window_noutrefresh_impl((PyCursesWindowObject *)self); + PyObject *return_value = NULL; + + return_value = _curses_window_noutrefresh_impl((PyCursesWindowObject *)self); + + return return_value; } #endif /* !defined(py_is_pad) */ @@ -1479,6 +1483,19 @@ PyDoc_STRVAR(_curses_window_putwin__doc__, #define _CURSES_WINDOW_PUTWIN_METHODDEF \ {"putwin", (PyCFunction)_curses_window_putwin, METH_O, _curses_window_putwin__doc__}, +static PyObject * +_curses_window_putwin_impl(PyCursesWindowObject *self, PyObject *file); + +static PyObject * +_curses_window_putwin(PyObject *self, PyObject *file) +{ + PyObject *return_value = NULL; + + return_value = _curses_window_putwin_impl((PyCursesWindowObject *)self, file); + + return return_value; +} + PyDoc_STRVAR(_curses_window_redrawln__doc__, "redrawln($self, beg, num, /)\n" "--\n" @@ -4379,4 +4396,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=c4211865ed96c2af input=a9049054013a1b77]*/ +/*[clinic end generated code: output=841c5e5714faf9c5 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h index 5e503194408776..076316d57e85de 100644 --- a/Modules/clinic/_dbmmodule.c.h +++ b/Modules/clinic/_dbmmodule.c.h @@ -22,7 +22,11 @@ _dbm_dbm_close_impl(dbmobject *self); static PyObject * _dbm_dbm_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _dbm_dbm_close_impl((dbmobject *)self); + PyObject *return_value = NULL; + + return_value = _dbm_dbm_close_impl((dbmobject *)self); + + return return_value; } PyDoc_STRVAR(_dbm_dbm_keys__doc__, @@ -40,11 +44,16 @@ _dbm_dbm_keys_impl(dbmobject *self, PyTypeObject *cls); static PyObject * _dbm_dbm_keys(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "keys() takes no arguments"); - return NULL; + goto exit; } - return _dbm_dbm_keys_impl((dbmobject *)self, cls); + return_value = _dbm_dbm_keys_impl((dbmobject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_dbm_dbm_get__doc__, @@ -152,11 +161,16 @@ _dbm_dbm_clear_impl(dbmobject *self, PyTypeObject *cls); static PyObject * _dbm_dbm_clear(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "clear() takes no arguments"); - return NULL; + goto exit; } - return _dbm_dbm_clear_impl((dbmobject *)self, cls); + return_value = _dbm_dbm_clear_impl((dbmobject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(dbmopen__doc__, @@ -221,4 +235,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=3b456118f231b160 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c6eba7e58b6f969a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 78391887b615cf..44a56cab783e65 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -71,7 +71,11 @@ _elementtree_Element_clear_impl(ElementObject *self); static PyObject * _elementtree_Element_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _elementtree_Element_clear_impl((ElementObject *)self); + PyObject *return_value = NULL; + + return_value = _elementtree_Element_clear_impl((ElementObject *)self); + + return return_value; } PyDoc_STRVAR(_elementtree_Element___copy____doc__, @@ -88,11 +92,16 @@ _elementtree_Element___copy___impl(ElementObject *self, PyTypeObject *cls); static PyObject * _elementtree_Element___copy__(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "__copy__() takes no arguments"); - return NULL; + goto exit; } - return _elementtree_Element___copy___impl((ElementObject *)self, cls); + return_value = _elementtree_Element___copy___impl((ElementObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_elementtree_Element___deepcopy____doc__, @@ -164,7 +173,11 @@ _elementtree_Element___getstate___impl(ElementObject *self); static PyObject * _elementtree_Element___getstate__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _elementtree_Element___getstate___impl((ElementObject *)self); + PyObject *return_value = NULL; + + return_value = _elementtree_Element___getstate___impl((ElementObject *)self); + + return return_value; } PyDoc_STRVAR(_elementtree_Element___setstate____doc__, @@ -653,11 +666,16 @@ _elementtree_Element_itertext_impl(ElementObject *self, PyTypeObject *cls); static PyObject * _elementtree_Element_itertext(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "itertext() takes no arguments"); - return NULL; + goto exit; } - return _elementtree_Element_itertext_impl((ElementObject *)self, cls); + return_value = _elementtree_Element_itertext_impl((ElementObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_elementtree_Element_insert__doc__, @@ -719,7 +737,11 @@ _elementtree_Element_items_impl(ElementObject *self); static PyObject * _elementtree_Element_items(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _elementtree_Element_items_impl((ElementObject *)self); + PyObject *return_value = NULL; + + return_value = _elementtree_Element_items_impl((ElementObject *)self); + + return return_value; } PyDoc_STRVAR(_elementtree_Element_keys__doc__, @@ -736,7 +758,11 @@ _elementtree_Element_keys_impl(ElementObject *self); static PyObject * _elementtree_Element_keys(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _elementtree_Element_keys_impl((ElementObject *)self); + PyObject *return_value = NULL; + + return_value = _elementtree_Element_keys_impl((ElementObject *)self); + + return return_value; } PyDoc_STRVAR(_elementtree_Element_makeelement__doc__, @@ -984,6 +1010,19 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_data__doc__, #define _ELEMENTTREE_TREEBUILDER_DATA_METHODDEF \ {"data", (PyCFunction)_elementtree_TreeBuilder_data, METH_O, _elementtree_TreeBuilder_data__doc__}, +static PyObject * +_elementtree_TreeBuilder_data_impl(TreeBuilderObject *self, PyObject *data); + +static PyObject * +_elementtree_TreeBuilder_data(PyObject *self, PyObject *data) +{ + PyObject *return_value = NULL; + + return_value = _elementtree_TreeBuilder_data_impl((TreeBuilderObject *)self, data); + + return return_value; +} + PyDoc_STRVAR(_elementtree_TreeBuilder_end__doc__, "end($self, tag, /)\n" "--\n" @@ -992,6 +1031,19 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_end__doc__, #define _ELEMENTTREE_TREEBUILDER_END_METHODDEF \ {"end", (PyCFunction)_elementtree_TreeBuilder_end, METH_O, _elementtree_TreeBuilder_end__doc__}, +static PyObject * +_elementtree_TreeBuilder_end_impl(TreeBuilderObject *self, PyObject *tag); + +static PyObject * +_elementtree_TreeBuilder_end(PyObject *self, PyObject *tag) +{ + PyObject *return_value = NULL; + + return_value = _elementtree_TreeBuilder_end_impl((TreeBuilderObject *)self, tag); + + return return_value; +} + PyDoc_STRVAR(_elementtree_TreeBuilder_comment__doc__, "comment($self, text, /)\n" "--\n" @@ -1000,6 +1052,20 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_comment__doc__, #define _ELEMENTTREE_TREEBUILDER_COMMENT_METHODDEF \ {"comment", (PyCFunction)_elementtree_TreeBuilder_comment, METH_O, _elementtree_TreeBuilder_comment__doc__}, +static PyObject * +_elementtree_TreeBuilder_comment_impl(TreeBuilderObject *self, + PyObject *text); + +static PyObject * +_elementtree_TreeBuilder_comment(PyObject *self, PyObject *text) +{ + PyObject *return_value = NULL; + + return_value = _elementtree_TreeBuilder_comment_impl((TreeBuilderObject *)self, text); + + return return_value; +} + PyDoc_STRVAR(_elementtree_TreeBuilder_pi__doc__, "pi($self, target, text=None, /)\n" "--\n" @@ -1048,7 +1114,11 @@ _elementtree_TreeBuilder_close_impl(TreeBuilderObject *self); static PyObject * _elementtree_TreeBuilder_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _elementtree_TreeBuilder_close_impl((TreeBuilderObject *)self); + PyObject *return_value = NULL; + + return_value = _elementtree_TreeBuilder_close_impl((TreeBuilderObject *)self); + + return return_value; } PyDoc_STRVAR(_elementtree_TreeBuilder_start__doc__, @@ -1178,7 +1248,11 @@ _elementtree_XMLParser_close_impl(XMLParserObject *self); static PyObject * _elementtree_XMLParser_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _elementtree_XMLParser_close_impl((XMLParserObject *)self); + PyObject *return_value = NULL; + + return_value = _elementtree_XMLParser_close_impl((XMLParserObject *)self); + + return return_value; } PyDoc_STRVAR(_elementtree_XMLParser_flush__doc__, @@ -1195,7 +1269,11 @@ _elementtree_XMLParser_flush_impl(XMLParserObject *self); static PyObject * _elementtree_XMLParser_flush(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _elementtree_XMLParser_flush_impl((XMLParserObject *)self); + PyObject *return_value = NULL; + + return_value = _elementtree_XMLParser_flush_impl((XMLParserObject *)self); + + return return_value; } PyDoc_STRVAR(_elementtree_XMLParser_feed__doc__, @@ -1206,6 +1284,19 @@ PyDoc_STRVAR(_elementtree_XMLParser_feed__doc__, #define _ELEMENTTREE_XMLPARSER_FEED_METHODDEF \ {"feed", (PyCFunction)_elementtree_XMLParser_feed, METH_O, _elementtree_XMLParser_feed__doc__}, +static PyObject * +_elementtree_XMLParser_feed_impl(XMLParserObject *self, PyObject *data); + +static PyObject * +_elementtree_XMLParser_feed(PyObject *self, PyObject *data) +{ + PyObject *return_value = NULL; + + return_value = _elementtree_XMLParser_feed_impl((XMLParserObject *)self, data); + + return return_value; +} + PyDoc_STRVAR(_elementtree_XMLParser__parse_whole__doc__, "_parse_whole($self, file, /)\n" "--\n" @@ -1214,6 +1305,20 @@ PyDoc_STRVAR(_elementtree_XMLParser__parse_whole__doc__, #define _ELEMENTTREE_XMLPARSER__PARSE_WHOLE_METHODDEF \ {"_parse_whole", (PyCFunction)_elementtree_XMLParser__parse_whole, METH_O, _elementtree_XMLParser__parse_whole__doc__}, +static PyObject * +_elementtree_XMLParser__parse_whole_impl(XMLParserObject *self, + PyObject *file); + +static PyObject * +_elementtree_XMLParser__parse_whole(PyObject *self, PyObject *file) +{ + PyObject *return_value = NULL; + + return_value = _elementtree_XMLParser__parse_whole_impl((XMLParserObject *)self, file); + + return return_value; +} + PyDoc_STRVAR(_elementtree_XMLParser__setevents__doc__, "_setevents($self, events_queue, events_to_report=None, /)\n" "--\n" @@ -1248,4 +1353,4 @@ _elementtree_XMLParser__setevents(PyObject *self, PyObject *const *args, Py_ssiz exit: return return_value; } -/*[clinic end generated code: output=e5c758958f14f102 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4a5f5d213fe87e16 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h index 00950f18e53541..1f901b8d632431 100644 --- a/Modules/clinic/_gdbmmodule.c.h +++ b/Modules/clinic/_gdbmmodule.c.h @@ -91,7 +91,11 @@ _gdbm_gdbm_close_impl(gdbmobject *self); static PyObject * _gdbm_gdbm_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _gdbm_gdbm_close_impl((gdbmobject *)self); + PyObject *return_value = NULL; + + return_value = _gdbm_gdbm_close_impl((gdbmobject *)self); + + return return_value; } PyDoc_STRVAR(_gdbm_gdbm_keys__doc__, @@ -109,11 +113,16 @@ _gdbm_gdbm_keys_impl(gdbmobject *self, PyTypeObject *cls); static PyObject * _gdbm_gdbm_keys(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "keys() takes no arguments"); - return NULL; + goto exit; } - return _gdbm_gdbm_keys_impl((gdbmobject *)self, cls); + return_value = _gdbm_gdbm_keys_impl((gdbmobject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_gdbm_gdbm_firstkey__doc__, @@ -135,11 +144,16 @@ _gdbm_gdbm_firstkey_impl(gdbmobject *self, PyTypeObject *cls); static PyObject * _gdbm_gdbm_firstkey(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "firstkey() takes no arguments"); - return NULL; + goto exit; } - return _gdbm_gdbm_firstkey_impl((gdbmobject *)self, cls); + return_value = _gdbm_gdbm_firstkey_impl((gdbmobject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_gdbm_gdbm_nextkey__doc__, @@ -214,11 +228,16 @@ _gdbm_gdbm_reorganize_impl(gdbmobject *self, PyTypeObject *cls); static PyObject * _gdbm_gdbm_reorganize(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "reorganize() takes no arguments"); - return NULL; + goto exit; } - return _gdbm_gdbm_reorganize_impl((gdbmobject *)self, cls); + return_value = _gdbm_gdbm_reorganize_impl((gdbmobject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_gdbm_gdbm_sync__doc__, @@ -239,11 +258,16 @@ _gdbm_gdbm_sync_impl(gdbmobject *self, PyTypeObject *cls); static PyObject * _gdbm_gdbm_sync(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "sync() takes no arguments"); - return NULL; + goto exit; } - return _gdbm_gdbm_sync_impl((gdbmobject *)self, cls); + return_value = _gdbm_gdbm_sync_impl((gdbmobject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_gdbm_gdbm_clear__doc__, @@ -261,11 +285,16 @@ _gdbm_gdbm_clear_impl(gdbmobject *self, PyTypeObject *cls); static PyObject * _gdbm_gdbm_clear(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "clear() takes no arguments"); - return NULL; + goto exit; } - return _gdbm_gdbm_clear_impl((gdbmobject *)self, cls); + return_value = _gdbm_gdbm_clear_impl((gdbmobject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(dbmopen__doc__, @@ -343,4 +372,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=d974cb39e4ee5d67 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=524bfb0fb71263fd input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index d219b80b791a66..5afcfb58eefc7b 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -24,7 +24,11 @@ EVP_copy_impl(EVPobject *self); static PyObject * EVP_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return EVP_copy_impl((EVPobject *)self); + PyObject *return_value = NULL; + + return_value = EVP_copy_impl((EVPobject *)self); + + return return_value; } PyDoc_STRVAR(EVP_digest__doc__, @@ -42,7 +46,11 @@ EVP_digest_impl(EVPobject *self); static PyObject * EVP_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return EVP_digest_impl((EVPobject *)self); + PyObject *return_value = NULL; + + return_value = EVP_digest_impl((EVPobject *)self); + + return return_value; } PyDoc_STRVAR(EVP_hexdigest__doc__, @@ -60,7 +68,11 @@ EVP_hexdigest_impl(EVPobject *self); static PyObject * EVP_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return EVP_hexdigest_impl((EVPobject *)self); + PyObject *return_value = NULL; + + return_value = EVP_hexdigest_impl((EVPobject *)self); + + return return_value; } PyDoc_STRVAR(EVP_update__doc__, @@ -72,6 +84,19 @@ PyDoc_STRVAR(EVP_update__doc__, #define EVP_UPDATE_METHODDEF \ {"update", (PyCFunction)EVP_update, METH_O, EVP_update__doc__}, +static PyObject * +EVP_update_impl(EVPobject *self, PyObject *obj); + +static PyObject * +EVP_update(PyObject *self, PyObject *obj) +{ + PyObject *return_value = NULL; + + return_value = EVP_update_impl((EVPobject *)self, obj); + + return return_value; +} + #if defined(PY_OPENSSL_HAS_SHAKE) PyDoc_STRVAR(EVPXOF_digest__doc__, @@ -1636,7 +1661,11 @@ _hashlib_HMAC_copy_impl(HMACobject *self); static PyObject * _hashlib_HMAC_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _hashlib_HMAC_copy_impl((HMACobject *)self); + PyObject *return_value = NULL; + + return_value = _hashlib_HMAC_copy_impl((HMACobject *)self); + + return return_value; } PyDoc_STRVAR(_hashlib_HMAC_update__doc__, @@ -1710,7 +1739,11 @@ _hashlib_HMAC_digest_impl(HMACobject *self); static PyObject * _hashlib_HMAC_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _hashlib_HMAC_digest_impl((HMACobject *)self); + PyObject *return_value = NULL; + + return_value = _hashlib_HMAC_digest_impl((HMACobject *)self); + + return return_value; } PyDoc_STRVAR(_hashlib_HMAC_hexdigest__doc__, @@ -1731,7 +1764,11 @@ _hashlib_HMAC_hexdigest_impl(HMACobject *self); static PyObject * _hashlib_HMAC_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _hashlib_HMAC_hexdigest_impl((HMACobject *)self); + PyObject *return_value = NULL; + + return_value = _hashlib_HMAC_hexdigest_impl((HMACobject *)self); + + return return_value; } PyDoc_STRVAR(_hashlib_get_fips_mode__doc__, @@ -1844,4 +1881,4 @@ _hashlib_compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t narg #ifndef _HASHLIB_SCRYPT_METHODDEF #define _HASHLIB_SCRYPT_METHODDEF #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */ -/*[clinic end generated code: output=811a8b50beae1018 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=140f479c4eaea484 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lsprof.c.h b/Modules/clinic/_lsprof.c.h index 6a75a8f9833d1e..e322b7cc52f8a0 100644 --- a/Modules/clinic/_lsprof.c.h +++ b/Modules/clinic/_lsprof.c.h @@ -45,11 +45,16 @@ _lsprof_Profiler_getstats_impl(ProfilerObject *self, PyTypeObject *cls); static PyObject * _lsprof_Profiler_getstats(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "getstats() takes no arguments"); - return NULL; + goto exit; } - return _lsprof_Profiler_getstats_impl((ProfilerObject *)self, cls); + return_value = _lsprof_Profiler_getstats_impl((ProfilerObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_lsprof_Profiler__pystart_callback__doc__, @@ -285,7 +290,11 @@ _lsprof_Profiler_disable_impl(ProfilerObject *self); static PyObject * _lsprof_Profiler_disable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _lsprof_Profiler_disable_impl((ProfilerObject *)self); + PyObject *return_value = NULL; + + return_value = _lsprof_Profiler_disable_impl((ProfilerObject *)self); + + return return_value; } PyDoc_STRVAR(_lsprof_Profiler_clear__doc__, @@ -303,7 +312,11 @@ _lsprof_Profiler_clear_impl(ProfilerObject *self); static PyObject * _lsprof_Profiler_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _lsprof_Profiler_clear_impl((ProfilerObject *)self); + PyObject *return_value = NULL; + + return_value = _lsprof_Profiler_clear_impl((ProfilerObject *)self); + + return return_value; } PyDoc_STRVAR(profiler_init__doc__, @@ -407,4 +420,4 @@ profiler_init(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=d983dbf23fd8ac3b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5326524fe31145ce input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h index c7c81d8d1f1b9d..9f41df1530b1cd 100644 --- a/Modules/clinic/_lzmamodule.c.h +++ b/Modules/clinic/_lzmamodule.c.h @@ -65,7 +65,11 @@ _lzma_LZMACompressor_flush_impl(Compressor *self); static PyObject * _lzma_LZMACompressor_flush(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _lzma_LZMACompressor_flush_impl((Compressor *)self); + PyObject *return_value = NULL; + + return_value = _lzma_LZMACompressor_flush_impl((Compressor *)self); + + return return_value; } PyDoc_STRVAR(_lzma_LZMADecompressor_decompress__doc__, @@ -329,4 +333,4 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz return return_value; } -/*[clinic end generated code: output=19ed9b1182f5ddf9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b60d44e0f424f625 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h index 91d355c5afb353..d19b0af9259c47 100644 --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -28,7 +28,11 @@ _pickle_Pickler_clear_memo_impl(PicklerObject *self); static PyObject * _pickle_Pickler_clear_memo(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _pickle_Pickler_clear_memo_impl((PicklerObject *)self); + PyObject *return_value = NULL; + + return_value = _pickle_Pickler_clear_memo_impl((PicklerObject *)self); + + return return_value; } PyDoc_STRVAR(_pickle_Pickler_dump__doc__, @@ -229,7 +233,11 @@ _pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self); static PyObject * _pickle_PicklerMemoProxy_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _pickle_PicklerMemoProxy_clear_impl((PicklerMemoProxyObject *)self); + PyObject *return_value = NULL; + + return_value = _pickle_PicklerMemoProxy_clear_impl((PicklerMemoProxyObject *)self); + + return return_value; } PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__, @@ -247,7 +255,11 @@ _pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self); static PyObject * _pickle_PicklerMemoProxy_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _pickle_PicklerMemoProxy_copy_impl((PicklerMemoProxyObject *)self); + PyObject *return_value = NULL; + + return_value = _pickle_PicklerMemoProxy_copy_impl((PicklerMemoProxyObject *)self); + + return return_value; } PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__, @@ -265,7 +277,11 @@ _pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self); static PyObject * _pickle_PicklerMemoProxy___reduce__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _pickle_PicklerMemoProxy___reduce___impl((PicklerMemoProxyObject *)self); + PyObject *return_value = NULL; + + return_value = _pickle_PicklerMemoProxy___reduce___impl((PicklerMemoProxyObject *)self); + + return return_value; } PyDoc_STRVAR(_pickle_Unpickler_persistent_load__doc__, @@ -331,11 +347,16 @@ _pickle_Unpickler_load_impl(UnpicklerObject *self, PyTypeObject *cls); static PyObject * _pickle_Unpickler_load(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "load() takes no arguments"); - return NULL; + goto exit; } - return _pickle_Unpickler_load_impl((UnpicklerObject *)self, cls); + return_value = _pickle_Unpickler_load_impl((UnpicklerObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__, @@ -568,7 +589,11 @@ _pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self); static PyObject * _pickle_UnpicklerMemoProxy_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _pickle_UnpicklerMemoProxy_clear_impl((UnpicklerMemoProxyObject *)self); + PyObject *return_value = NULL; + + return_value = _pickle_UnpicklerMemoProxy_clear_impl((UnpicklerMemoProxyObject *)self); + + return return_value; } PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__, @@ -586,7 +611,11 @@ _pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self); static PyObject * _pickle_UnpicklerMemoProxy_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _pickle_UnpicklerMemoProxy_copy_impl((UnpicklerMemoProxyObject *)self); + PyObject *return_value = NULL; + + return_value = _pickle_UnpicklerMemoProxy_copy_impl((UnpicklerMemoProxyObject *)self); + + return return_value; } PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__, @@ -604,7 +633,11 @@ _pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self); static PyObject * _pickle_UnpicklerMemoProxy___reduce__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _pickle_UnpicklerMemoProxy___reduce___impl((UnpicklerMemoProxyObject *)self); + PyObject *return_value = NULL; + + return_value = _pickle_UnpicklerMemoProxy___reduce___impl((UnpicklerMemoProxyObject *)self); + + return return_value; } PyDoc_STRVAR(_pickle_dump__doc__, @@ -1086,4 +1119,4 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=d71dc73af298ebe8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f37ff045f4feec40 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_randommodule.c.h b/Modules/clinic/_randommodule.c.h index b2d67e11c63595..1e989e970c9de5 100644 --- a/Modules/clinic/_randommodule.c.h +++ b/Modules/clinic/_randommodule.c.h @@ -103,7 +103,7 @@ static PyObject * _random_Random_setstate_impl(RandomObject *self, PyObject *state); static PyObject * -_random_Random_setstate(RandomObject *self, PyObject *state) +_random_Random_setstate(PyObject *self, PyObject *state) { PyObject *return_value = NULL; @@ -143,4 +143,4 @@ _random_Random_getrandbits(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=859cfbf59c133a4e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4458b5a69201ebea input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index 73c5d304f1a141..93bda4e0259685 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -255,7 +255,11 @@ _ssl__SSLSocket_compression_impl(PySSLSocket *self); static PyObject * _ssl__SSLSocket_compression(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _ssl__SSLSocket_compression_impl((PySSLSocket *)self); + PyObject *return_value = NULL; + + return_value = _ssl__SSLSocket_compression_impl((PySSLSocket *)self); + + return return_value; } PyDoc_STRVAR(_ssl__SSLSocket_context__doc__, @@ -1520,7 +1524,7 @@ static PyObject * _ssl__SSLContext_load_dh_params_impl(PySSLContext *self, PyObject *filepath); static PyObject * -_ssl__SSLContext_load_dh_params(PySSLContext *self, PyObject *filepath) +_ssl__SSLContext_load_dh_params(PyObject *self, PyObject *filepath) { PyObject *return_value = NULL; @@ -1784,7 +1788,7 @@ static PyObject * _ssl__SSLContext_set_ecdh_curve_impl(PySSLContext *self, PyObject *name); static PyObject * -_ssl__SSLContext_set_ecdh_curve(PySSLContext *self, PyObject *name) +_ssl__SSLContext_set_ecdh_curve(PyObject *self, PyObject *name) { PyObject *return_value = NULL; @@ -2878,4 +2882,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=bededfb2b927bd41 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c0c80336beff60df input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h index 7cf179f7a69d55..0e50395f70d827 100644 --- a/Modules/clinic/_struct.c.h +++ b/Modules/clinic/_struct.c.h @@ -209,6 +209,19 @@ PyDoc_STRVAR(Struct_iter_unpack__doc__, #define STRUCT_ITER_UNPACK_METHODDEF \ {"iter_unpack", (PyCFunction)Struct_iter_unpack, METH_O, Struct_iter_unpack__doc__}, +static PyObject * +Struct_iter_unpack_impl(PyStructObject *self, PyObject *buffer); + +static PyObject * +Struct_iter_unpack(PyObject *self, PyObject *buffer) +{ + PyObject *return_value = NULL; + + return_value = Struct_iter_unpack_impl((PyStructObject *)self, buffer); + + return return_value; +} + PyDoc_STRVAR(_clearcache__doc__, "_clearcache($module, /)\n" "--\n" @@ -439,4 +452,4 @@ iter_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=ec540c21be08e1d0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c7c051850b7ad427 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testmultiphase.c.h b/Modules/clinic/_testmultiphase.c.h index 01c29c0753ae13..63b6ab48a9b066 100644 --- a/Modules/clinic/_testmultiphase.c.h +++ b/Modules/clinic/_testmultiphase.c.h @@ -27,11 +27,16 @@ _testmultiphase_StateAccessType_get_defining_module_impl(StateAccessTypeObject * static PyObject * _testmultiphase_StateAccessType_get_defining_module(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "get_defining_module() takes no arguments"); - return NULL; + goto exit; } - return _testmultiphase_StateAccessType_get_defining_module_impl((StateAccessTypeObject *)self, cls); + return_value = _testmultiphase_StateAccessType_get_defining_module_impl((StateAccessTypeObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_testmultiphase_StateAccessType_getmodulebydef_bad_def__doc__, @@ -50,11 +55,16 @@ _testmultiphase_StateAccessType_getmodulebydef_bad_def_impl(StateAccessTypeObjec static PyObject * _testmultiphase_StateAccessType_getmodulebydef_bad_def(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "getmodulebydef_bad_def() takes no arguments"); - return NULL; + goto exit; } - return _testmultiphase_StateAccessType_getmodulebydef_bad_def_impl((StateAccessTypeObject *)self, cls); + return_value = _testmultiphase_StateAccessType_getmodulebydef_bad_def_impl((StateAccessTypeObject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(_testmultiphase_StateAccessType_increment_count_clinic__doc__, @@ -157,10 +167,15 @@ _testmultiphase_StateAccessType_get_count_impl(StateAccessTypeObject *self, static PyObject * _testmultiphase_StateAccessType_get_count(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "get_count() takes no arguments"); - return NULL; + goto exit; } - return _testmultiphase_StateAccessType_get_count_impl((StateAccessTypeObject *)self, cls); + return_value = _testmultiphase_StateAccessType_get_count_impl((StateAccessTypeObject *)self, cls); + +exit: + return return_value; } -/*[clinic end generated code: output=ea0ca98e467e53c2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fc80df68095b414a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h index d6e783b04fe968..1a66221c327371 100644 --- a/Modules/clinic/_tkinter.c.h +++ b/Modules/clinic/_tkinter.c.h @@ -156,6 +156,19 @@ PyDoc_STRVAR(_tkinter_tkapp_getint__doc__, #define _TKINTER_TKAPP_GETINT_METHODDEF \ {"getint", (PyCFunction)_tkinter_tkapp_getint, METH_O, _tkinter_tkapp_getint__doc__}, +static PyObject * +_tkinter_tkapp_getint_impl(TkappObject *self, PyObject *arg); + +static PyObject * +_tkinter_tkapp_getint(PyObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + + return_value = _tkinter_tkapp_getint_impl((TkappObject *)self, arg); + + return return_value; +} + PyDoc_STRVAR(_tkinter_tkapp_getdouble__doc__, "getdouble($self, arg, /)\n" "--\n" @@ -164,6 +177,19 @@ PyDoc_STRVAR(_tkinter_tkapp_getdouble__doc__, #define _TKINTER_TKAPP_GETDOUBLE_METHODDEF \ {"getdouble", (PyCFunction)_tkinter_tkapp_getdouble, METH_O, _tkinter_tkapp_getdouble__doc__}, +static PyObject * +_tkinter_tkapp_getdouble_impl(TkappObject *self, PyObject *arg); + +static PyObject * +_tkinter_tkapp_getdouble(PyObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + + return_value = _tkinter_tkapp_getdouble_impl((TkappObject *)self, arg); + + return return_value; +} + PyDoc_STRVAR(_tkinter_tkapp_getboolean__doc__, "getboolean($self, arg, /)\n" "--\n" @@ -172,6 +198,19 @@ PyDoc_STRVAR(_tkinter_tkapp_getboolean__doc__, #define _TKINTER_TKAPP_GETBOOLEAN_METHODDEF \ {"getboolean", (PyCFunction)_tkinter_tkapp_getboolean, METH_O, _tkinter_tkapp_getboolean__doc__}, +static PyObject * +_tkinter_tkapp_getboolean_impl(TkappObject *self, PyObject *arg); + +static PyObject * +_tkinter_tkapp_getboolean(PyObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + + return_value = _tkinter_tkapp_getboolean_impl((TkappObject *)self, arg); + + return return_value; +} + PyDoc_STRVAR(_tkinter_tkapp_exprstring__doc__, "exprstring($self, s, /)\n" "--\n" @@ -324,6 +363,19 @@ PyDoc_STRVAR(_tkinter_tkapp_splitlist__doc__, #define _TKINTER_TKAPP_SPLITLIST_METHODDEF \ {"splitlist", (PyCFunction)_tkinter_tkapp_splitlist, METH_O, _tkinter_tkapp_splitlist__doc__}, +static PyObject * +_tkinter_tkapp_splitlist_impl(TkappObject *self, PyObject *arg); + +static PyObject * +_tkinter_tkapp_splitlist(PyObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + + return_value = _tkinter_tkapp_splitlist_impl((TkappObject *)self, arg); + + return return_value; +} + PyDoc_STRVAR(_tkinter_tkapp_createcommand__doc__, "createcommand($self, name, func, /)\n" "--\n" @@ -451,6 +503,19 @@ PyDoc_STRVAR(_tkinter_tkapp_deletefilehandler__doc__, #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF \ {"deletefilehandler", (PyCFunction)_tkinter_tkapp_deletefilehandler, METH_O, _tkinter_tkapp_deletefilehandler__doc__}, +static PyObject * +_tkinter_tkapp_deletefilehandler_impl(TkappObject *self, PyObject *file); + +static PyObject * +_tkinter_tkapp_deletefilehandler(PyObject *self, PyObject *file) +{ + PyObject *return_value = NULL; + + return_value = _tkinter_tkapp_deletefilehandler_impl((TkappObject *)self, file); + + return return_value; +} + #endif /* defined(HAVE_CREATEFILEHANDLER) */ PyDoc_STRVAR(_tkinter_tktimertoken_deletetimerhandler__doc__, @@ -467,7 +532,11 @@ _tkinter_tktimertoken_deletetimerhandler_impl(TkttObject *self); static PyObject * _tkinter_tktimertoken_deletetimerhandler(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _tkinter_tktimertoken_deletetimerhandler_impl((TkttObject *)self); + PyObject *return_value = NULL; + + return_value = _tkinter_tktimertoken_deletetimerhandler_impl((TkttObject *)self); + + return return_value; } PyDoc_STRVAR(_tkinter_tkapp_createtimerhandler__doc__, @@ -585,7 +654,11 @@ _tkinter_tkapp_quit_impl(TkappObject *self); static PyObject * _tkinter_tkapp_quit(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _tkinter_tkapp_quit_impl((TkappObject *)self); + PyObject *return_value = NULL; + + return_value = _tkinter_tkapp_quit_impl((TkappObject *)self); + + return return_value; } PyDoc_STRVAR(_tkinter_tkapp_interpaddr__doc__, @@ -602,7 +675,11 @@ _tkinter_tkapp_interpaddr_impl(TkappObject *self); static PyObject * _tkinter_tkapp_interpaddr(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _tkinter_tkapp_interpaddr_impl((TkappObject *)self); + PyObject *return_value = NULL; + + return_value = _tkinter_tkapp_interpaddr_impl((TkappObject *)self); + + return return_value; } PyDoc_STRVAR(_tkinter_tkapp_loadtk__doc__, @@ -619,7 +696,11 @@ _tkinter_tkapp_loadtk_impl(TkappObject *self); static PyObject * _tkinter_tkapp_loadtk(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _tkinter_tkapp_loadtk_impl((TkappObject *)self); + PyObject *return_value = NULL; + + return_value = _tkinter_tkapp_loadtk_impl((TkappObject *)self); + + return return_value; } PyDoc_STRVAR(_tkinter_tkapp_settrace__doc__, @@ -631,6 +712,19 @@ PyDoc_STRVAR(_tkinter_tkapp_settrace__doc__, #define _TKINTER_TKAPP_SETTRACE_METHODDEF \ {"settrace", (PyCFunction)_tkinter_tkapp_settrace, METH_O, _tkinter_tkapp_settrace__doc__}, +static PyObject * +_tkinter_tkapp_settrace_impl(TkappObject *self, PyObject *func); + +static PyObject * +_tkinter_tkapp_settrace(PyObject *self, PyObject *func) +{ + PyObject *return_value = NULL; + + return_value = _tkinter_tkapp_settrace_impl((TkappObject *)self, func); + + return return_value; +} + PyDoc_STRVAR(_tkinter_tkapp_gettrace__doc__, "gettrace($self, /)\n" "--\n" @@ -646,7 +740,11 @@ _tkinter_tkapp_gettrace_impl(TkappObject *self); static PyObject * _tkinter_tkapp_gettrace(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _tkinter_tkapp_gettrace_impl((TkappObject *)self); + PyObject *return_value = NULL; + + return_value = _tkinter_tkapp_gettrace_impl((TkappObject *)self); + + return return_value; } PyDoc_STRVAR(_tkinter_tkapp_willdispatch__doc__, @@ -663,7 +761,11 @@ _tkinter_tkapp_willdispatch_impl(TkappObject *self); static PyObject * _tkinter_tkapp_willdispatch(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _tkinter_tkapp_willdispatch_impl((TkappObject *)self); + PyObject *return_value = NULL; + + return_value = _tkinter_tkapp_willdispatch_impl((TkappObject *)self); + + return return_value; } PyDoc_STRVAR(_tkinter__flatten__doc__, @@ -888,4 +990,4 @@ _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ -/*[clinic end generated code: output=172a98df5f209a84 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4a4b9d107654402e input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h index 6a2f8d45cd4e0c..baa97db6a2680f 100644 --- a/Modules/clinic/_winapi.c.h +++ b/Modules/clinic/_winapi.c.h @@ -50,7 +50,11 @@ _winapi_Overlapped_getbuffer_impl(OverlappedObject *self); static PyObject * _winapi_Overlapped_getbuffer(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _winapi_Overlapped_getbuffer_impl((OverlappedObject *)self); + PyObject *return_value = NULL; + + return_value = _winapi_Overlapped_getbuffer_impl((OverlappedObject *)self); + + return return_value; } PyDoc_STRVAR(_winapi_Overlapped_cancel__doc__, @@ -67,7 +71,11 @@ _winapi_Overlapped_cancel_impl(OverlappedObject *self); static PyObject * _winapi_Overlapped_cancel(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _winapi_Overlapped_cancel_impl((OverlappedObject *)self); + PyObject *return_value = NULL; + + return_value = _winapi_Overlapped_cancel_impl((OverlappedObject *)self); + + return return_value; } PyDoc_STRVAR(_winapi_CloseHandle__doc__, @@ -2127,4 +2135,4 @@ _winapi_CopyFile2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO return return_value; } -/*[clinic end generated code: output=06b56212b2186250 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fa34c08199a78ab2 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h index 3816bb7709658e..23cf04ae3db381 100644 --- a/Modules/clinic/arraymodule.c.h +++ b/Modules/clinic/arraymodule.c.h @@ -70,7 +70,7 @@ static PyObject * array_array___deepcopy___impl(arrayobject *self, PyObject *unused); static PyObject * -array_array___deepcopy__(arrayobject *self, PyObject *unused) +array_array___deepcopy__(PyObject *self, PyObject *unused) { PyObject *return_value = NULL; @@ -94,7 +94,7 @@ static PyObject * array_array_count_impl(arrayobject *self, PyObject *v); static PyObject * -array_array_count(arrayobject *self, PyObject *v) +array_array_count(PyObject *self, PyObject *v) { PyObject *return_value = NULL; @@ -166,7 +166,7 @@ static PyObject * array_array_remove_impl(arrayobject *self, PyObject *v); static PyObject * -array_array_remove(arrayobject *self, PyObject *v) +array_array_remove(PyObject *self, PyObject *v) { PyObject *return_value = NULL; @@ -351,7 +351,7 @@ static PyObject * array_array_append_impl(arrayobject *self, PyObject *v); static PyObject * -array_array_append(arrayobject *self, PyObject *v) +array_array_append(PyObject *self, PyObject *v) { PyObject *return_value = NULL; @@ -530,7 +530,7 @@ static PyObject * array_array_fromlist_impl(arrayobject *self, PyObject *list); static PyObject * -array_array_fromlist(arrayobject *self, PyObject *list) +array_array_fromlist(PyObject *self, PyObject *list) { PyObject *return_value = NULL; @@ -701,7 +701,11 @@ array_array___sizeof___impl(arrayobject *self); static PyObject * array_array___sizeof__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return array_array___sizeof___impl((arrayobject *)self); + PyObject *return_value = NULL; + + return_value = array_array___sizeof___impl((arrayobject *)self); + + return return_value; } PyDoc_STRVAR(array__array_reconstructor__doc__, @@ -818,11 +822,16 @@ array_arrayiterator___reduce___impl(arrayiterobject *self, PyTypeObject *cls); static PyObject * array_arrayiterator___reduce__(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "__reduce__() takes no arguments"); - return NULL; + goto exit; } - return array_arrayiterator___reduce___impl((arrayiterobject *)self, cls); + return_value = array_arrayiterator___reduce___impl((arrayiterobject *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(array_arrayiterator___setstate____doc__, @@ -833,4 +842,17 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__, #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, -/*[clinic end generated code: output=c9219e074c62e0c8 input=a9049054013a1b77]*/ + +static PyObject * +array_arrayiterator___setstate___impl(arrayiterobject *self, PyObject *state); + +static PyObject * +array_arrayiterator___setstate__(PyObject *self, PyObject *state) +{ + PyObject *return_value = NULL; + + return_value = array_arrayiterator___setstate___impl((arrayiterobject *)self, state); + + return return_value; +} +/*[clinic end generated code: output=f9a91e294a35f475 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/blake2module.c.h b/Modules/clinic/blake2module.c.h index b5ac90143a1740..42edd25186bf38 100644 --- a/Modules/clinic/blake2module.c.h +++ b/Modules/clinic/blake2module.c.h @@ -414,7 +414,11 @@ _blake2_blake2b_copy_impl(Blake2Object *self); static PyObject * _blake2_blake2b_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _blake2_blake2b_copy_impl((Blake2Object *)self); + PyObject *return_value = NULL; + + return_value = _blake2_blake2b_copy_impl((Blake2Object *)self); + + return return_value; } PyDoc_STRVAR(_blake2_blake2b_update__doc__, @@ -426,6 +430,19 @@ PyDoc_STRVAR(_blake2_blake2b_update__doc__, #define _BLAKE2_BLAKE2B_UPDATE_METHODDEF \ {"update", (PyCFunction)_blake2_blake2b_update, METH_O, _blake2_blake2b_update__doc__}, +static PyObject * +_blake2_blake2b_update_impl(Blake2Object *self, PyObject *data); + +static PyObject * +_blake2_blake2b_update(PyObject *self, PyObject *data) +{ + PyObject *return_value = NULL; + + return_value = _blake2_blake2b_update_impl((Blake2Object *)self, data); + + return return_value; +} + PyDoc_STRVAR(_blake2_blake2b_digest__doc__, "digest($self, /)\n" "--\n" @@ -441,7 +458,11 @@ _blake2_blake2b_digest_impl(Blake2Object *self); static PyObject * _blake2_blake2b_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _blake2_blake2b_digest_impl((Blake2Object *)self); + PyObject *return_value = NULL; + + return_value = _blake2_blake2b_digest_impl((Blake2Object *)self); + + return return_value; } PyDoc_STRVAR(_blake2_blake2b_hexdigest__doc__, @@ -459,6 +480,10 @@ _blake2_blake2b_hexdigest_impl(Blake2Object *self); static PyObject * _blake2_blake2b_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _blake2_blake2b_hexdigest_impl((Blake2Object *)self); + PyObject *return_value = NULL; + + return_value = _blake2_blake2b_hexdigest_impl((Blake2Object *)self); + + return return_value; } -/*[clinic end generated code: output=6e03c947b7e0d973 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=436fd660c7dce811 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index 1f0acebf47b6ff..21d5ac001ac183 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -23,11 +23,16 @@ MD5Type_copy_impl(MD5object *self, PyTypeObject *cls); static PyObject * MD5Type_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - return NULL; + goto exit; } - return MD5Type_copy_impl((MD5object *)self, cls); + return_value = MD5Type_copy_impl((MD5object *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(MD5Type_digest__doc__, @@ -45,7 +50,11 @@ MD5Type_digest_impl(MD5object *self); static PyObject * MD5Type_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return MD5Type_digest_impl((MD5object *)self); + PyObject *return_value = NULL; + + return_value = MD5Type_digest_impl((MD5object *)self); + + return return_value; } PyDoc_STRVAR(MD5Type_hexdigest__doc__, @@ -63,7 +72,11 @@ MD5Type_hexdigest_impl(MD5object *self); static PyObject * MD5Type_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return MD5Type_hexdigest_impl((MD5object *)self); + PyObject *return_value = NULL; + + return_value = MD5Type_hexdigest_impl((MD5object *)self); + + return return_value; } PyDoc_STRVAR(MD5Type_update__doc__, @@ -75,6 +88,19 @@ PyDoc_STRVAR(MD5Type_update__doc__, #define MD5TYPE_UPDATE_METHODDEF \ {"update", (PyCFunction)MD5Type_update, METH_O, MD5Type_update__doc__}, +static PyObject * +MD5Type_update_impl(MD5object *self, PyObject *obj); + +static PyObject * +MD5Type_update(PyObject *self, PyObject *obj) +{ + PyObject *return_value = NULL; + + return_value = MD5Type_update_impl((MD5object *)self, obj); + + return return_value; +} + PyDoc_STRVAR(_md5_md5__doc__, "md5($module, /, string=b\'\', *, usedforsecurity=True)\n" "--\n" @@ -149,4 +175,4 @@ _md5_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw exit: return return_value; } -/*[clinic end generated code: output=a4292eab710dcb60 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bbca8d26f2a4258d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/overlapped.c.h b/Modules/clinic/overlapped.c.h index 7e5715660022c1..685a0a3e4ee422 100644 --- a/Modules/clinic/overlapped.c.h +++ b/Modules/clinic/overlapped.c.h @@ -518,7 +518,11 @@ _overlapped_Overlapped_cancel_impl(OverlappedObject *self); static PyObject * _overlapped_Overlapped_cancel(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _overlapped_Overlapped_cancel_impl((OverlappedObject *)self); + PyObject *return_value = NULL; + + return_value = _overlapped_Overlapped_cancel_impl((OverlappedObject *)self); + + return return_value; } PyDoc_STRVAR(_overlapped_Overlapped_getresult__doc__, @@ -1240,4 +1244,4 @@ _overlapped_Overlapped_WSARecvFromInto(PyObject *self, PyObject *const *args, Py return return_value; } -/*[clinic end generated code: output=d009cc9e53d9732a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=94e4cf1b39345ef4 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index abeb9c3e3e12b1..c38c6bf3456ad1 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -11985,7 +11985,11 @@ os_DirEntry_inode_impl(DirEntry *self); static PyObject * os_DirEntry_inode(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return os_DirEntry_inode_impl((DirEntry *)self); + PyObject *return_value = NULL; + + return_value = os_DirEntry_inode_impl((DirEntry *)self); + + return return_value; } PyDoc_STRVAR(os_DirEntry___fspath____doc__, @@ -12003,7 +12007,11 @@ os_DirEntry___fspath___impl(DirEntry *self); static PyObject * os_DirEntry___fspath__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return os_DirEntry___fspath___impl((DirEntry *)self); + PyObject *return_value = NULL; + + return_value = os_DirEntry___fspath___impl((DirEntry *)self); + + return return_value; } PyDoc_STRVAR(os_scandir__doc__, @@ -13196,4 +13204,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=8318c26fc2cd236c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cb777904adc99e47 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h index 9eba59731c3fba..284c5252c68062 100644 --- a/Modules/clinic/pyexpat.c.h +++ b/Modules/clinic/pyexpat.c.h @@ -52,7 +52,11 @@ pyexpat_xmlparser_GetReparseDeferralEnabled_impl(xmlparseobject *self); static PyObject * pyexpat_xmlparser_GetReparseDeferralEnabled(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pyexpat_xmlparser_GetReparseDeferralEnabled_impl((xmlparseobject *)self); + PyObject *return_value = NULL; + + return_value = pyexpat_xmlparser_GetReparseDeferralEnabled_impl((xmlparseobject *)self); + + return return_value; } PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__, @@ -208,7 +212,11 @@ pyexpat_xmlparser_GetBase_impl(xmlparseobject *self); static PyObject * pyexpat_xmlparser_GetBase(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pyexpat_xmlparser_GetBase_impl((xmlparseobject *)self); + PyObject *return_value = NULL; + + return_value = pyexpat_xmlparser_GetBase_impl((xmlparseobject *)self); + + return return_value; } PyDoc_STRVAR(pyexpat_xmlparser_GetInputContext__doc__, @@ -229,7 +237,11 @@ pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self); static PyObject * pyexpat_xmlparser_GetInputContext(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return pyexpat_xmlparser_GetInputContext_impl((xmlparseobject *)self); + PyObject *return_value = NULL; + + return_value = pyexpat_xmlparser_GetInputContext_impl((xmlparseobject *)self); + + return return_value; } PyDoc_STRVAR(pyexpat_xmlparser_ExternalEntityParserCreate__doc__, @@ -550,4 +562,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg) #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=7ee30ae5b666d0a8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5ce407e79b4f0108 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/selectmodule.c.h b/Modules/clinic/selectmodule.c.h index d8bdd6f95f3d29..034fd9b6a9c905 100644 --- a/Modules/clinic/selectmodule.c.h +++ b/Modules/clinic/selectmodule.c.h @@ -673,7 +673,11 @@ select_epoll_fileno_impl(pyEpoll_Object *self); static PyObject * select_epoll_fileno(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return select_epoll_fileno_impl((pyEpoll_Object *)self); + PyObject *return_value = NULL; + + return_value = select_epoll_fileno_impl((pyEpoll_Object *)self); + + return return_value; } #endif /* defined(HAVE_EPOLL) */ @@ -1033,7 +1037,11 @@ select_epoll___enter___impl(pyEpoll_Object *self); static PyObject * select_epoll___enter__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return select_epoll___enter___impl((pyEpoll_Object *)self); + PyObject *return_value = NULL; + + return_value = select_epoll___enter___impl((pyEpoll_Object *)self); + + return return_value; } #endif /* defined(HAVE_EPOLL) */ @@ -1176,7 +1184,11 @@ select_kqueue_fileno_impl(kqueue_queue_Object *self); static PyObject * select_kqueue_fileno(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return select_kqueue_fileno_impl((kqueue_queue_Object *)self); + PyObject *return_value = NULL; + + return_value = select_kqueue_fileno_impl((kqueue_queue_Object *)self); + + return return_value; } #endif /* defined(HAVE_KQUEUE) */ @@ -1365,4 +1377,4 @@ select_kqueue_control(PyObject *self, PyObject *const *args, Py_ssize_t nargs) #ifndef SELECT_KQUEUE_CONTROL_METHODDEF #define SELECT_KQUEUE_CONTROL_METHODDEF #endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */ -/*[clinic end generated code: output=c18fd93efc5f4dce input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c4c4122e737a5f7d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h index ddd8e66a41d7ff..0be2bb9d56d321 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -23,11 +23,16 @@ SHA1Type_copy_impl(SHA1object *self, PyTypeObject *cls); static PyObject * SHA1Type_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - return NULL; + goto exit; } - return SHA1Type_copy_impl((SHA1object *)self, cls); + return_value = SHA1Type_copy_impl((SHA1object *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(SHA1Type_digest__doc__, @@ -45,7 +50,11 @@ SHA1Type_digest_impl(SHA1object *self); static PyObject * SHA1Type_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return SHA1Type_digest_impl((SHA1object *)self); + PyObject *return_value = NULL; + + return_value = SHA1Type_digest_impl((SHA1object *)self); + + return return_value; } PyDoc_STRVAR(SHA1Type_hexdigest__doc__, @@ -63,7 +72,11 @@ SHA1Type_hexdigest_impl(SHA1object *self); static PyObject * SHA1Type_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return SHA1Type_hexdigest_impl((SHA1object *)self); + PyObject *return_value = NULL; + + return_value = SHA1Type_hexdigest_impl((SHA1object *)self); + + return return_value; } PyDoc_STRVAR(SHA1Type_update__doc__, @@ -75,6 +88,19 @@ PyDoc_STRVAR(SHA1Type_update__doc__, #define SHA1TYPE_UPDATE_METHODDEF \ {"update", (PyCFunction)SHA1Type_update, METH_O, SHA1Type_update__doc__}, +static PyObject * +SHA1Type_update_impl(SHA1object *self, PyObject *obj); + +static PyObject * +SHA1Type_update(PyObject *self, PyObject *obj) +{ + PyObject *return_value = NULL; + + return_value = SHA1Type_update_impl((SHA1object *)self, obj); + + return return_value; +} + PyDoc_STRVAR(_sha1_sha1__doc__, "sha1($module, /, string=b\'\', *, usedforsecurity=True)\n" "--\n" @@ -149,4 +175,4 @@ _sha1_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * exit: return return_value; } -/*[clinic end generated code: output=ad6f3788a6e7ff6f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d42333a7ee032349 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha2module.c.h b/Modules/clinic/sha2module.c.h index d86f5510d752e8..9e0a71b99ee2ab 100644 --- a/Modules/clinic/sha2module.c.h +++ b/Modules/clinic/sha2module.c.h @@ -23,11 +23,16 @@ SHA256Type_copy_impl(SHA256object *self, PyTypeObject *cls); static PyObject * SHA256Type_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - return NULL; + goto exit; } - return SHA256Type_copy_impl((SHA256object *)self, cls); + return_value = SHA256Type_copy_impl((SHA256object *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(SHA512Type_copy__doc__, @@ -45,11 +50,16 @@ SHA512Type_copy_impl(SHA512object *self, PyTypeObject *cls); static PyObject * SHA512Type_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - return NULL; + goto exit; } - return SHA512Type_copy_impl((SHA512object *)self, cls); + return_value = SHA512Type_copy_impl((SHA512object *)self, cls); + +exit: + return return_value; } PyDoc_STRVAR(SHA256Type_digest__doc__, @@ -67,7 +77,11 @@ SHA256Type_digest_impl(SHA256object *self); static PyObject * SHA256Type_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return SHA256Type_digest_impl((SHA256object *)self); + PyObject *return_value = NULL; + + return_value = SHA256Type_digest_impl((SHA256object *)self); + + return return_value; } PyDoc_STRVAR(SHA512Type_digest__doc__, @@ -85,7 +99,11 @@ SHA512Type_digest_impl(SHA512object *self); static PyObject * SHA512Type_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return SHA512Type_digest_impl((SHA512object *)self); + PyObject *return_value = NULL; + + return_value = SHA512Type_digest_impl((SHA512object *)self); + + return return_value; } PyDoc_STRVAR(SHA256Type_hexdigest__doc__, @@ -103,7 +121,11 @@ SHA256Type_hexdigest_impl(SHA256object *self); static PyObject * SHA256Type_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return SHA256Type_hexdigest_impl((SHA256object *)self); + PyObject *return_value = NULL; + + return_value = SHA256Type_hexdigest_impl((SHA256object *)self); + + return return_value; } PyDoc_STRVAR(SHA512Type_hexdigest__doc__, @@ -121,7 +143,11 @@ SHA512Type_hexdigest_impl(SHA512object *self); static PyObject * SHA512Type_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return SHA512Type_hexdigest_impl((SHA512object *)self); + PyObject *return_value = NULL; + + return_value = SHA512Type_hexdigest_impl((SHA512object *)self); + + return return_value; } PyDoc_STRVAR(SHA256Type_update__doc__, @@ -133,6 +159,19 @@ PyDoc_STRVAR(SHA256Type_update__doc__, #define SHA256TYPE_UPDATE_METHODDEF \ {"update", (PyCFunction)SHA256Type_update, METH_O, SHA256Type_update__doc__}, +static PyObject * +SHA256Type_update_impl(SHA256object *self, PyObject *obj); + +static PyObject * +SHA256Type_update(PyObject *self, PyObject *obj) +{ + PyObject *return_value = NULL; + + return_value = SHA256Type_update_impl((SHA256object *)self, obj); + + return return_value; +} + PyDoc_STRVAR(SHA512Type_update__doc__, "update($self, obj, /)\n" "--\n" @@ -142,6 +181,19 @@ PyDoc_STRVAR(SHA512Type_update__doc__, #define SHA512TYPE_UPDATE_METHODDEF \ {"update", (PyCFunction)SHA512Type_update, METH_O, SHA512Type_update__doc__}, +static PyObject * +SHA512Type_update_impl(SHA512object *self, PyObject *obj); + +static PyObject * +SHA512Type_update(PyObject *self, PyObject *obj) +{ + PyObject *return_value = NULL; + + return_value = SHA512Type_update_impl((SHA512object *)self, obj); + + return return_value; +} + PyDoc_STRVAR(_sha2_sha256__doc__, "sha256($module, /, string=b\'\', *, usedforsecurity=True)\n" "--\n" @@ -441,4 +493,4 @@ _sha2_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject exit: return return_value; } -/*[clinic end generated code: output=1d7fec114eb6b6e3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b8cb790573fddd96 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha3module.c.h b/Modules/clinic/sha3module.c.h index 729e216ce023cf..815bde6cda73e8 100644 --- a/Modules/clinic/sha3module.c.h +++ b/Modules/clinic/sha3module.c.h @@ -94,7 +94,11 @@ _sha3_sha3_224_copy_impl(SHA3object *self); static PyObject * _sha3_sha3_224_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _sha3_sha3_224_copy_impl((SHA3object *)self); + PyObject *return_value = NULL; + + return_value = _sha3_sha3_224_copy_impl((SHA3object *)self); + + return return_value; } PyDoc_STRVAR(_sha3_sha3_224_digest__doc__, @@ -112,7 +116,11 @@ _sha3_sha3_224_digest_impl(SHA3object *self); static PyObject * _sha3_sha3_224_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _sha3_sha3_224_digest_impl((SHA3object *)self); + PyObject *return_value = NULL; + + return_value = _sha3_sha3_224_digest_impl((SHA3object *)self); + + return return_value; } PyDoc_STRVAR(_sha3_sha3_224_hexdigest__doc__, @@ -130,7 +138,11 @@ _sha3_sha3_224_hexdigest_impl(SHA3object *self); static PyObject * _sha3_sha3_224_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _sha3_sha3_224_hexdigest_impl((SHA3object *)self); + PyObject *return_value = NULL; + + return_value = _sha3_sha3_224_hexdigest_impl((SHA3object *)self); + + return return_value; } PyDoc_STRVAR(_sha3_sha3_224_update__doc__, @@ -142,6 +154,19 @@ PyDoc_STRVAR(_sha3_sha3_224_update__doc__, #define _SHA3_SHA3_224_UPDATE_METHODDEF \ {"update", (PyCFunction)_sha3_sha3_224_update, METH_O, _sha3_sha3_224_update__doc__}, +static PyObject * +_sha3_sha3_224_update_impl(SHA3object *self, PyObject *data); + +static PyObject * +_sha3_sha3_224_update(PyObject *self, PyObject *data) +{ + PyObject *return_value = NULL; + + return_value = _sha3_sha3_224_update_impl((SHA3object *)self, data); + + return return_value; +} + PyDoc_STRVAR(_sha3_shake_128_digest__doc__, "digest($self, length, /)\n" "--\n" @@ -195,4 +220,4 @@ _sha3_shake_128_hexdigest(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=21da06d9570969d8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2e42278f2fd830ff input=a9049054013a1b77]*/ diff --git a/Modules/clinic/socketmodule.c.h b/Modules/clinic/socketmodule.c.h index dc62c4290d3e3b..c1601e503a7a9b 100644 --- a/Modules/clinic/socketmodule.c.h +++ b/Modules/clinic/socketmodule.c.h @@ -25,7 +25,11 @@ _socket_socket_close_impl(PySocketSockObject *s); static PyObject * _socket_socket_close(PyObject *s, PyObject *Py_UNUSED(ignored)) { - return _socket_socket_close_impl((PySocketSockObject *)s); + PyObject *return_value = NULL; + + return_value = _socket_socket_close_impl((PySocketSockObject *)s); + + return return_value; } static int @@ -280,4 +284,4 @@ _socket_socket_if_nametoindex(PyObject *self, PyObject *arg) #ifndef _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF #define _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF #endif /* !defined(_SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF) */ -/*[clinic end generated code: output=d39efc30d811e74b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b6072fee513b1e0d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h index 91a3ac76bcf0cc..8f54a2abb4f9e5 100644 --- a/Modules/clinic/zlibmodule.c.h +++ b/Modules/clinic/zlibmodule.c.h @@ -644,11 +644,16 @@ zlib_Compress_copy_impl(compobject *self, PyTypeObject *cls); static PyObject * zlib_Compress_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - return NULL; + goto exit; } - return zlib_Compress_copy_impl((compobject *)self, cls); + return_value = zlib_Compress_copy_impl((compobject *)self, cls); + +exit: + return return_value; } #endif /* defined(HAVE_ZLIB_COPY) */ @@ -669,11 +674,16 @@ zlib_Compress___copy___impl(compobject *self, PyTypeObject *cls); static PyObject * zlib_Compress___copy__(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "__copy__() takes no arguments"); - return NULL; + goto exit; } - return zlib_Compress___copy___impl((compobject *)self, cls); + return_value = zlib_Compress___copy___impl((compobject *)self, cls); + +exit: + return return_value; } #endif /* defined(HAVE_ZLIB_COPY) */ @@ -743,11 +753,16 @@ zlib_Decompress_copy_impl(compobject *self, PyTypeObject *cls); static PyObject * zlib_Decompress_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - return NULL; + goto exit; } - return zlib_Decompress_copy_impl((compobject *)self, cls); + return_value = zlib_Decompress_copy_impl((compobject *)self, cls); + +exit: + return return_value; } #endif /* defined(HAVE_ZLIB_COPY) */ @@ -768,11 +783,16 @@ zlib_Decompress___copy___impl(compobject *self, PyTypeObject *cls); static PyObject * zlib_Decompress___copy__(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "__copy__() takes no arguments"); - return NULL; + goto exit; } - return zlib_Decompress___copy___impl((compobject *)self, cls); + return_value = zlib_Decompress___copy___impl((compobject *)self, cls); + +exit: + return return_value; } #endif /* defined(HAVE_ZLIB_COPY) */ @@ -1109,4 +1129,4 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */ -/*[clinic end generated code: output=969872868c303e8a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=75fc32ea26219e44 input=a9049054013a1b77]*/ diff --git a/Modules/md5module.c b/Modules/md5module.c index d86c8e555012d7..b4f279c3fbadfd 100644 --- a/Modules/md5module.c +++ b/Modules/md5module.c @@ -194,8 +194,8 @@ Update this hash object's state with the provided string. [clinic start generated code]*/ static PyObject * -MD5Type_update(MD5object *self, PyObject *obj) -/*[clinic end generated code: output=f6ad168416338423 input=6e1efcd9ecf17032]*/ +MD5Type_update_impl(MD5object *self, PyObject *obj) +/*[clinic end generated code: output=b0fed9a7ce7ad253 input=6e1efcd9ecf17032]*/ { Py_buffer buf; diff --git a/Modules/sha1module.c b/Modules/sha1module.c index d0b1e8250770d0..2ff00b3ae58e4f 100644 --- a/Modules/sha1module.c +++ b/Modules/sha1module.c @@ -187,8 +187,8 @@ Update this hash object's state with the provided string. [clinic start generated code]*/ static PyObject * -SHA1Type_update(SHA1object *self, PyObject *obj) -/*[clinic end generated code: output=d9902f0e5015e9ae input=aad8e07812edbba3]*/ +SHA1Type_update_impl(SHA1object *self, PyObject *obj) +/*[clinic end generated code: output=cdc8e0e106dbec5f input=aad8e07812edbba3]*/ { Py_buffer buf; diff --git a/Modules/sha2module.c b/Modules/sha2module.c index 45fa120cf76758..be79cbc0b1c477 100644 --- a/Modules/sha2module.c +++ b/Modules/sha2module.c @@ -368,8 +368,8 @@ Update this hash object's state with the provided string. [clinic start generated code]*/ static PyObject * -SHA256Type_update(SHA256object *self, PyObject *obj) -/*[clinic end generated code: output=1b240f965ddbd8c6 input=b2d449d5b30f0f5a]*/ +SHA256Type_update_impl(SHA256object *self, PyObject *obj) +/*[clinic end generated code: output=dc58a580cf8905a5 input=b2d449d5b30f0f5a]*/ { Py_buffer buf; @@ -402,8 +402,8 @@ Update this hash object's state with the provided string. [clinic start generated code]*/ static PyObject * -SHA512Type_update(SHA512object *self, PyObject *obj) -/*[clinic end generated code: output=745f51057a985884 input=ded2b46656566283]*/ +SHA512Type_update_impl(SHA512object *self, PyObject *obj) +/*[clinic end generated code: output=9af211766c0b7365 input=ded2b46656566283]*/ { Py_buffer buf; diff --git a/Modules/sha3module.c b/Modules/sha3module.c index 72a11602b0e1fd..5514033d997aec 100644 --- a/Modules/sha3module.c +++ b/Modules/sha3module.c @@ -271,8 +271,8 @@ Update this hash object's state with the provided bytes-like object. [clinic start generated code]*/ static PyObject * -_sha3_sha3_224_update(SHA3object *self, PyObject *data) -/*[clinic end generated code: output=d3223352286ed357 input=a887f54dcc4ae227]*/ +_sha3_sha3_224_update_impl(SHA3object *self, PyObject *data) +/*[clinic end generated code: output=390b7abf7c9795a5 input=a887f54dcc4ae227]*/ { Py_buffer buf; diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index b3d1c425ad18b7..ba642d3788fc78 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -1883,8 +1883,8 @@ Example: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'. [clinic start generated code]*/ static PyObject * -bytes_join(PyBytesObject *self, PyObject *iterable_of_bytes) -/*[clinic end generated code: output=a046f379f626f6f8 input=7fe377b95bd549d2]*/ +bytes_join_impl(PyBytesObject *self, PyObject *iterable_of_bytes) +/*[clinic end generated code: output=0687abb94d7d438e input=7fe377b95bd549d2]*/ { return stringlib_bytes_join((PyObject*)self, iterable_of_bytes); } diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index 183ad13dd3448e..de78015e6c591d 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -222,7 +222,11 @@ bytearray_clear_impl(PyByteArrayObject *self); static PyObject * bytearray_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return bytearray_clear_impl((PyByteArrayObject *)self); + PyObject *return_value = NULL; + + return_value = bytearray_clear_impl((PyByteArrayObject *)self); + + return return_value; } PyDoc_STRVAR(bytearray_copy__doc__, @@ -929,7 +933,7 @@ static PyObject * bytearray_partition_impl(PyByteArrayObject *self, PyObject *sep); static PyObject * -bytearray_partition(PyByteArrayObject *self, PyObject *sep) +bytearray_partition(PyObject *self, PyObject *sep) { PyObject *return_value = NULL; @@ -961,7 +965,7 @@ static PyObject * bytearray_rpartition_impl(PyByteArrayObject *self, PyObject *sep); static PyObject * -bytearray_rpartition(PyByteArrayObject *self, PyObject *sep) +bytearray_rpartition(PyObject *self, PyObject *sep) { PyObject *return_value = NULL; @@ -1186,7 +1190,7 @@ static PyObject * bytearray_extend_impl(PyByteArrayObject *self, PyObject *iterable_of_ints); static PyObject * -bytearray_extend(PyByteArrayObject *self, PyObject *iterable_of_ints) +bytearray_extend(PyObject *self, PyObject *iterable_of_ints) { PyObject *return_value = NULL; @@ -1509,7 +1513,7 @@ static PyObject * bytearray_join_impl(PyByteArrayObject *self, PyObject *iterable_of_bytes); static PyObject * -bytearray_join(PyByteArrayObject *self, PyObject *iterable_of_bytes) +bytearray_join(PyObject *self, PyObject *iterable_of_bytes) { PyObject *return_value = NULL; @@ -1787,6 +1791,10 @@ bytearray_sizeof_impl(PyByteArrayObject *self); static PyObject * bytearray_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return bytearray_sizeof_impl((PyByteArrayObject *)self); + PyObject *return_value = NULL; + + return_value = bytearray_sizeof_impl((PyByteArrayObject *)self); + + return return_value; } -/*[clinic end generated code: output=5e33422343b47af9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e5c4d4489ac7d6a4 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index 9aef736428ad0e..cbc0f955c73fe4 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -24,7 +24,11 @@ bytes___bytes___impl(PyBytesObject *self); static PyObject * bytes___bytes__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return bytes___bytes___impl((PyBytesObject *)self); + PyObject *return_value = NULL; + + return_value = bytes___bytes___impl((PyBytesObject *)self); + + return return_value; } PyDoc_STRVAR(bytes_split__doc__, @@ -296,6 +300,19 @@ PyDoc_STRVAR(bytes_join__doc__, #define BYTES_JOIN_METHODDEF \ {"join", (PyCFunction)bytes_join, METH_O, bytes_join__doc__}, +static PyObject * +bytes_join_impl(PyBytesObject *self, PyObject *iterable_of_bytes); + +static PyObject * +bytes_join(PyObject *self, PyObject *iterable_of_bytes) +{ + PyObject *return_value = NULL; + + return_value = bytes_join_impl((PyBytesObject *)self, iterable_of_bytes); + + return return_value; +} + PyDoc_STRVAR(bytes_find__doc__, "find($self, sub[, start[, end]], /)\n" "--\n" @@ -1391,4 +1408,4 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=96fe2d6ef9ac8f6a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e9ae159473126636 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/classobject.c.h b/Objects/clinic/classobject.c.h index 5934f1c2a41669..7589b2e8316f66 100644 --- a/Objects/clinic/classobject.c.h +++ b/Objects/clinic/classobject.c.h @@ -18,7 +18,11 @@ method___reduce___impl(PyMethodObject *self); static PyObject * method___reduce__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return method___reduce___impl((PyMethodObject *)self); + PyObject *return_value = NULL; + + return_value = method___reduce___impl((PyMethodObject *)self); + + return return_value; } PyDoc_STRVAR(method_new__doc__, @@ -82,4 +86,4 @@ instancemethod_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=ab546abf90aac94e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d6078cc5f501c317 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/complexobject.c.h b/Objects/clinic/complexobject.c.h index e00da1d960c54d..9dd7a78ba6a87b 100644 --- a/Objects/clinic/complexobject.c.h +++ b/Objects/clinic/complexobject.c.h @@ -23,7 +23,11 @@ complex_conjugate_impl(PyComplexObject *self); static PyObject * complex_conjugate(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return complex_conjugate_impl((PyComplexObject *)self); + PyObject *return_value = NULL; + + return_value = complex_conjugate_impl((PyComplexObject *)self); + + return return_value; } PyDoc_STRVAR(complex___getnewargs____doc__, @@ -40,7 +44,11 @@ complex___getnewargs___impl(PyComplexObject *self); static PyObject * complex___getnewargs__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return complex___getnewargs___impl((PyComplexObject *)self); + PyObject *return_value = NULL; + + return_value = complex___getnewargs___impl((PyComplexObject *)self); + + return return_value; } PyDoc_STRVAR(complex___format____doc__, @@ -87,7 +95,11 @@ complex___complex___impl(PyComplexObject *self); static PyObject * complex___complex__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return complex___complex___impl((PyComplexObject *)self); + PyObject *return_value = NULL; + + return_value = complex___complex___impl((PyComplexObject *)self); + + return return_value; } PyDoc_STRVAR(complex_new__doc__, @@ -170,4 +182,4 @@ PyDoc_STRVAR(complex_from_number__doc__, #define COMPLEX_FROM_NUMBER_METHODDEF \ {"from_number", (PyCFunction)complex_from_number, METH_O|METH_CLASS, complex_from_number__doc__}, -/*[clinic end generated code: output=252cddef7f9169a0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9fe5ed58655d9f90 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h index c66916bb33aa37..9fb28ae1bb61e0 100644 --- a/Objects/clinic/dictobject.c.h +++ b/Objects/clinic/dictobject.c.h @@ -54,7 +54,11 @@ dict_copy_impl(PyDictObject *self); static PyObject * dict_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return dict_copy_impl((PyDictObject *)self); + PyObject *return_value = NULL; + + return_value = dict_copy_impl((PyDictObject *)self); + + return return_value; } PyDoc_STRVAR(dict___contains____doc__, @@ -66,6 +70,19 @@ PyDoc_STRVAR(dict___contains____doc__, #define DICT___CONTAINS___METHODDEF \ {"__contains__", (PyCFunction)dict___contains__, METH_O|METH_COEXIST, dict___contains____doc__}, +static PyObject * +dict___contains___impl(PyDictObject *self, PyObject *key); + +static PyObject * +dict___contains__(PyObject *self, PyObject *key) +{ + PyObject *return_value = NULL; + + return_value = dict___contains___impl((PyDictObject *)self, key); + + return return_value; +} + PyDoc_STRVAR(dict_get__doc__, "get($self, key, default=None, /)\n" "--\n" @@ -154,7 +171,11 @@ dict_clear_impl(PyDictObject *self); static PyObject * dict_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return dict_clear_impl((PyDictObject *)self); + PyObject *return_value = NULL; + + return_value = dict_clear_impl((PyDictObject *)self); + + return return_value; } PyDoc_STRVAR(dict_pop__doc__, @@ -236,7 +257,11 @@ dict___sizeof___impl(PyDictObject *self); static PyObject * dict___sizeof__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return dict___sizeof___impl((PyDictObject *)self); + PyObject *return_value = NULL; + + return_value = dict___sizeof___impl((PyDictObject *)self); + + return return_value; } PyDoc_STRVAR(dict___reversed____doc__, @@ -254,7 +279,11 @@ dict___reversed___impl(PyDictObject *self); static PyObject * dict___reversed__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return dict___reversed___impl((PyDictObject *)self); + PyObject *return_value = NULL; + + return_value = dict___reversed___impl((PyDictObject *)self); + + return return_value; } PyDoc_STRVAR(dict_keys__doc__, @@ -272,7 +301,11 @@ dict_keys_impl(PyDictObject *self); static PyObject * dict_keys(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return dict_keys_impl((PyDictObject *)self); + PyObject *return_value = NULL; + + return_value = dict_keys_impl((PyDictObject *)self); + + return return_value; } PyDoc_STRVAR(dict_items__doc__, @@ -290,7 +323,11 @@ dict_items_impl(PyDictObject *self); static PyObject * dict_items(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return dict_items_impl((PyDictObject *)self); + PyObject *return_value = NULL; + + return_value = dict_items_impl((PyDictObject *)self); + + return return_value; } PyDoc_STRVAR(dict_values__doc__, @@ -308,6 +345,10 @@ dict_values_impl(PyDictObject *self); static PyObject * dict_values(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return dict_values_impl((PyDictObject *)self); + PyObject *return_value = NULL; + + return_value = dict_values_impl((PyDictObject *)self); + + return return_value; } -/*[clinic end generated code: output=0f04bf0e7e6b130f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e5b485fd066e3751 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/exceptions.c.h b/Objects/clinic/exceptions.c.h index 8699df07495ad8..9baac8b1cc660b 100644 --- a/Objects/clinic/exceptions.c.h +++ b/Objects/clinic/exceptions.c.h @@ -40,7 +40,7 @@ static PyObject * BaseException___setstate___impl(PyBaseExceptionObject *self, PyObject *state); static PyObject * -BaseException___setstate__(PyBaseExceptionObject *self, PyObject *state) +BaseException___setstate__(PyObject *self, PyObject *state) { PyObject *return_value = NULL; @@ -64,7 +64,7 @@ static PyObject * BaseException_with_traceback_impl(PyBaseExceptionObject *self, PyObject *tb); static PyObject * -BaseException_with_traceback(PyBaseExceptionObject *self, PyObject *tb) +BaseException_with_traceback(PyObject *self, PyObject *tb) { PyObject *return_value = NULL; @@ -322,7 +322,7 @@ BaseExceptionGroup_derive_impl(PyBaseExceptionGroupObject *self, PyObject *excs); static PyObject * -BaseExceptionGroup_derive(PyBaseExceptionGroupObject *self, PyObject *excs) +BaseExceptionGroup_derive(PyObject *self, PyObject *excs) { PyObject *return_value = NULL; @@ -346,7 +346,7 @@ BaseExceptionGroup_split_impl(PyBaseExceptionGroupObject *self, PyObject *matcher_value); static PyObject * -BaseExceptionGroup_split(PyBaseExceptionGroupObject *self, PyObject *matcher_value) +BaseExceptionGroup_split(PyObject *self, PyObject *matcher_value) { PyObject *return_value = NULL; @@ -370,7 +370,7 @@ BaseExceptionGroup_subgroup_impl(PyBaseExceptionGroupObject *self, PyObject *matcher_value); static PyObject * -BaseExceptionGroup_subgroup(PyBaseExceptionGroupObject *self, PyObject *matcher_value) +BaseExceptionGroup_subgroup(PyObject *self, PyObject *matcher_value) { PyObject *return_value = NULL; @@ -380,4 +380,4 @@ BaseExceptionGroup_subgroup(PyBaseExceptionGroupObject *self, PyObject *matcher_ return return_value; } -/*[clinic end generated code: output=19aed708dcaf7184 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fcf70b3b71f3d14a input=a9049054013a1b77]*/ diff --git a/Objects/clinic/listobject.c.h b/Objects/clinic/listobject.c.h index a29ed9f7088700..3b5a386011daf5 100644 --- a/Objects/clinic/listobject.c.h +++ b/Objects/clinic/listobject.c.h @@ -114,7 +114,7 @@ static PyObject * list_append_impl(PyListObject *self, PyObject *object); static PyObject * -list_append(PyListObject *self, PyObject *object) +list_append(PyObject *self, PyObject *object) { PyObject *return_value = NULL; @@ -134,6 +134,19 @@ PyDoc_STRVAR(list_extend__doc__, #define LIST_EXTEND_METHODDEF \ {"extend", (PyCFunction)list_extend, METH_O, list_extend__doc__}, +static PyObject * +list_extend_impl(PyListObject *self, PyObject *iterable); + +static PyObject * +list_extend(PyObject *self, PyObject *iterable) +{ + PyObject *return_value = NULL; + + return_value = list_extend_impl((PyListObject *)self, iterable); + + return return_value; +} + PyDoc_STRVAR(list_pop__doc__, "pop($self, index=-1, /)\n" "--\n" @@ -341,6 +354,19 @@ PyDoc_STRVAR(list_count__doc__, #define LIST_COUNT_METHODDEF \ {"count", (PyCFunction)list_count, METH_O, list_count__doc__}, +static PyObject * +list_count_impl(PyListObject *self, PyObject *value); + +static PyObject * +list_count(PyObject *self, PyObject *value) +{ + PyObject *return_value = NULL; + + return_value = list_count_impl((PyListObject *)self, value); + + return return_value; +} + PyDoc_STRVAR(list_remove__doc__, "remove($self, value, /)\n" "--\n" @@ -356,7 +382,7 @@ static PyObject * list_remove_impl(PyListObject *self, PyObject *value); static PyObject * -list_remove(PyListObject *self, PyObject *value) +list_remove(PyObject *self, PyObject *value) { PyObject *return_value = NULL; @@ -420,7 +446,11 @@ list___sizeof___impl(PyListObject *self); static PyObject * list___sizeof__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return list___sizeof___impl((PyListObject *)self); + PyObject *return_value = NULL; + + return_value = list___sizeof___impl((PyListObject *)self); + + return return_value; } PyDoc_STRVAR(list___reversed____doc__, @@ -438,6 +468,10 @@ list___reversed___impl(PyListObject *self); static PyObject * list___reversed__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return list___reversed___impl((PyListObject *)self); + PyObject *return_value = NULL; + + return_value = list___reversed___impl((PyListObject *)self); + + return return_value; } -/*[clinic end generated code: output=35c43dc33f9ba521 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7047af1e69fd9d18 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/memoryobject.c.h b/Objects/clinic/memoryobject.c.h index 4706c92051926c..fafc98a78be7b7 100644 --- a/Objects/clinic/memoryobject.c.h +++ b/Objects/clinic/memoryobject.c.h @@ -139,7 +139,11 @@ memoryview_release_impl(PyMemoryViewObject *self); static PyObject * memoryview_release(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return memoryview_release_impl((PyMemoryViewObject *)self); + PyObject *return_value = NULL; + + return_value = memoryview_release_impl((PyMemoryViewObject *)self); + + return return_value; } PyDoc_STRVAR(memoryview_cast__doc__, @@ -225,7 +229,11 @@ memoryview_toreadonly_impl(PyMemoryViewObject *self); static PyObject * memoryview_toreadonly(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return memoryview_toreadonly_impl((PyMemoryViewObject *)self); + PyObject *return_value = NULL; + + return_value = memoryview_toreadonly_impl((PyMemoryViewObject *)self); + + return return_value; } PyDoc_STRVAR(memoryview_tolist__doc__, @@ -243,7 +251,11 @@ memoryview_tolist_impl(PyMemoryViewObject *self); static PyObject * memoryview_tolist(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return memoryview_tolist_impl((PyMemoryViewObject *)self); + PyObject *return_value = NULL; + + return_value = memoryview_tolist_impl((PyMemoryViewObject *)self); + + return return_value; } PyDoc_STRVAR(memoryview_tobytes__doc__, @@ -428,6 +440,19 @@ PyDoc_STRVAR(memoryview_count__doc__, #define MEMORYVIEW_COUNT_METHODDEF \ {"count", (PyCFunction)memoryview_count, METH_O, memoryview_count__doc__}, +static PyObject * +memoryview_count_impl(PyMemoryViewObject *self, PyObject *value); + +static PyObject * +memoryview_count(PyObject *self, PyObject *value) +{ + PyObject *return_value = NULL; + + return_value = memoryview_count_impl((PyMemoryViewObject *)self, value); + + return return_value; +} + PyDoc_STRVAR(memoryview_index__doc__, "index($self, value, start=0, stop=sys.maxsize, /)\n" "--\n" @@ -473,4 +498,4 @@ memoryview_index(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=2ef6c061d9c4e3dc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=37f6fd422ddd18af input=a9049054013a1b77]*/ diff --git a/Objects/clinic/setobject.c.h b/Objects/clinic/setobject.c.h index bf7e604e4b0a46..96c70d0ae95a46 100644 --- a/Objects/clinic/setobject.c.h +++ b/Objects/clinic/setobject.c.h @@ -223,7 +223,7 @@ static PyObject * set_isdisjoint_impl(PySetObject *so, PyObject *other); static PyObject * -set_isdisjoint(PySetObject *so, PyObject *other) +set_isdisjoint(PyObject *so, PyObject *other) { PyObject *return_value = NULL; @@ -297,6 +297,19 @@ PyDoc_STRVAR(set_symmetric_difference_update__doc__, #define SET_SYMMETRIC_DIFFERENCE_UPDATE_METHODDEF \ {"symmetric_difference_update", (PyCFunction)set_symmetric_difference_update, METH_O, set_symmetric_difference_update__doc__}, +static PyObject * +set_symmetric_difference_update_impl(PySetObject *so, PyObject *other); + +static PyObject * +set_symmetric_difference_update(PyObject *so, PyObject *other) +{ + PyObject *return_value = NULL; + + return_value = set_symmetric_difference_update_impl((PySetObject *)so, other); + + return return_value; +} + PyDoc_STRVAR(set_symmetric_difference__doc__, "symmetric_difference($self, other, /)\n" "--\n" @@ -310,7 +323,7 @@ static PyObject * set_symmetric_difference_impl(PySetObject *so, PyObject *other); static PyObject * -set_symmetric_difference(PySetObject *so, PyObject *other) +set_symmetric_difference(PyObject *so, PyObject *other) { PyObject *return_value = NULL; @@ -334,7 +347,7 @@ static PyObject * set_issubset_impl(PySetObject *so, PyObject *other); static PyObject * -set_issubset(PySetObject *so, PyObject *other) +set_issubset(PyObject *so, PyObject *other) { PyObject *return_value = NULL; @@ -358,7 +371,7 @@ static PyObject * set_issuperset_impl(PySetObject *so, PyObject *other); static PyObject * -set_issuperset(PySetObject *so, PyObject *other) +set_issuperset(PyObject *so, PyObject *other) { PyObject *return_value = NULL; @@ -384,7 +397,7 @@ static PyObject * set_add_impl(PySetObject *so, PyObject *key); static PyObject * -set_add(PySetObject *so, PyObject *key) +set_add(PyObject *so, PyObject *key) { PyObject *return_value = NULL; @@ -408,7 +421,7 @@ static PyObject * set___contains___impl(PySetObject *so, PyObject *key); static PyObject * -set___contains__(PySetObject *so, PyObject *key) +set___contains__(PyObject *so, PyObject *key) { PyObject *return_value = NULL; @@ -434,7 +447,7 @@ static PyObject * set_remove_impl(PySetObject *so, PyObject *key); static PyObject * -set_remove(PySetObject *so, PyObject *key) +set_remove(PyObject *so, PyObject *key) { PyObject *return_value = NULL; @@ -461,7 +474,7 @@ static PyObject * set_discard_impl(PySetObject *so, PyObject *key); static PyObject * -set_discard(PySetObject *so, PyObject *key) +set_discard(PyObject *so, PyObject *key) { PyObject *return_value = NULL; @@ -519,4 +532,4 @@ set___sizeof__(PyObject *so, PyObject *Py_UNUSED(ignored)) return return_value; } -/*[clinic end generated code: output=83b7742a762ce465 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e2f1470de062d661 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/tupleobject.c.h b/Objects/clinic/tupleobject.c.h index 40ffd4c1755769..fc044de3797206 100644 --- a/Objects/clinic/tupleobject.c.h +++ b/Objects/clinic/tupleobject.c.h @@ -59,6 +59,19 @@ PyDoc_STRVAR(tuple_count__doc__, #define TUPLE_COUNT_METHODDEF \ {"count", (PyCFunction)tuple_count, METH_O, tuple_count__doc__}, +static PyObject * +tuple_count_impl(PyTupleObject *self, PyObject *value); + +static PyObject * +tuple_count(PyObject *self, PyObject *value) +{ + PyObject *return_value = NULL; + + return_value = tuple_count_impl((PyTupleObject *)self, value); + + return return_value; +} + PyDoc_STRVAR(tuple_new__doc__, "tuple(iterable=(), /)\n" "--\n" @@ -112,6 +125,10 @@ tuple___getnewargs___impl(PyTupleObject *self); static PyObject * tuple___getnewargs__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return tuple___getnewargs___impl((PyTupleObject *)self); + PyObject *return_value = NULL; + + return_value = tuple___getnewargs___impl((PyTupleObject *)self); + + return return_value; } -/*[clinic end generated code: output=779cb4a13db67397 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7d7754943df5c955 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typeobject.c.h b/Objects/clinic/typeobject.c.h index 5e8187b3f5b748..90d4eb7c47283e 100644 --- a/Objects/clinic/typeobject.c.h +++ b/Objects/clinic/typeobject.c.h @@ -17,7 +17,7 @@ static int type___instancecheck___impl(PyTypeObject *self, PyObject *instance); static PyObject * -type___instancecheck__(PyTypeObject *self, PyObject *instance) +type___instancecheck__(PyObject *self, PyObject *instance) { PyObject *return_value = NULL; int _return_value; @@ -45,7 +45,7 @@ static int type___subclasscheck___impl(PyTypeObject *self, PyObject *subclass); static PyObject * -type___subclasscheck__(PyTypeObject *self, PyObject *subclass) +type___subclasscheck__(PyObject *self, PyObject *subclass) { PyObject *return_value = NULL; int _return_value; @@ -75,7 +75,11 @@ type_mro_impl(PyTypeObject *self); static PyObject * type_mro(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return type_mro_impl((PyTypeObject *)self); + PyObject *return_value = NULL; + + return_value = type_mro_impl((PyTypeObject *)self); + + return return_value; } PyDoc_STRVAR(type___subclasses____doc__, @@ -93,7 +97,11 @@ type___subclasses___impl(PyTypeObject *self); static PyObject * type___subclasses__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return type___subclasses___impl((PyTypeObject *)self); + PyObject *return_value = NULL; + + return_value = type___subclasses___impl((PyTypeObject *)self); + + return return_value; } PyDoc_STRVAR(type___dir____doc__, @@ -111,7 +119,11 @@ type___dir___impl(PyTypeObject *self); static PyObject * type___dir__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return type___dir___impl((PyTypeObject *)self); + PyObject *return_value = NULL; + + return_value = type___dir___impl((PyTypeObject *)self); + + return return_value; } PyDoc_STRVAR(type___sizeof____doc__, @@ -129,7 +141,11 @@ type___sizeof___impl(PyTypeObject *self); static PyObject * type___sizeof__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return type___sizeof___impl((PyTypeObject *)self); + PyObject *return_value = NULL; + + return_value = type___sizeof___impl((PyTypeObject *)self); + + return return_value; } PyDoc_STRVAR(object___getstate____doc__, @@ -262,4 +278,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return object___dir___impl(self); } -/*[clinic end generated code: output=f7db85fd11818c63 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bfa1e3547f298bbe input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typevarobject.c.h b/Objects/clinic/typevarobject.c.h index e50ed7d95b9b2a..e95f61303cb5fb 100644 --- a/Objects/clinic/typevarobject.c.h +++ b/Objects/clinic/typevarobject.c.h @@ -130,6 +130,19 @@ PyDoc_STRVAR(typevar_typing_subst__doc__, #define TYPEVAR_TYPING_SUBST_METHODDEF \ {"__typing_subst__", (PyCFunction)typevar_typing_subst, METH_O, typevar_typing_subst__doc__}, +static PyObject * +typevar_typing_subst_impl(typevarobject *self, PyObject *arg); + +static PyObject * +typevar_typing_subst(PyObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + + return_value = typevar_typing_subst_impl((typevarobject *)self, arg); + + return return_value; +} + PyDoc_STRVAR(typevar_typing_prepare_subst__doc__, "__typing_prepare_subst__($self, alias, args, /)\n" "--\n" @@ -174,7 +187,11 @@ typevar_reduce_impl(typevarobject *self); static PyObject * typevar_reduce(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return typevar_reduce_impl((typevarobject *)self); + PyObject *return_value = NULL; + + return_value = typevar_reduce_impl((typevarobject *)self); + + return return_value; } PyDoc_STRVAR(typevar_has_default__doc__, @@ -191,7 +208,11 @@ typevar_has_default_impl(typevarobject *self); static PyObject * typevar_has_default(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return typevar_has_default_impl((typevarobject *)self); + PyObject *return_value = NULL; + + return_value = typevar_has_default_impl((typevarobject *)self); + + return return_value; } PyDoc_STRVAR(paramspecargs_new__doc__, @@ -418,6 +439,19 @@ PyDoc_STRVAR(paramspec_typing_subst__doc__, #define PARAMSPEC_TYPING_SUBST_METHODDEF \ {"__typing_subst__", (PyCFunction)paramspec_typing_subst, METH_O, paramspec_typing_subst__doc__}, +static PyObject * +paramspec_typing_subst_impl(paramspecobject *self, PyObject *arg); + +static PyObject * +paramspec_typing_subst(PyObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + + return_value = paramspec_typing_subst_impl((paramspecobject *)self, arg); + + return return_value; +} + PyDoc_STRVAR(paramspec_typing_prepare_subst__doc__, "__typing_prepare_subst__($self, alias, args, /)\n" "--\n" @@ -462,7 +496,11 @@ paramspec_reduce_impl(paramspecobject *self); static PyObject * paramspec_reduce(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return paramspec_reduce_impl((paramspecobject *)self); + PyObject *return_value = NULL; + + return_value = paramspec_reduce_impl((paramspecobject *)self); + + return return_value; } PyDoc_STRVAR(paramspec_has_default__doc__, @@ -479,7 +517,11 @@ paramspec_has_default_impl(paramspecobject *self); static PyObject * paramspec_has_default(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return paramspec_has_default_impl((paramspecobject *)self); + PyObject *return_value = NULL; + + return_value = paramspec_has_default_impl((paramspecobject *)self); + + return return_value; } PyDoc_STRVAR(typevartuple__doc__, @@ -557,6 +599,19 @@ PyDoc_STRVAR(typevartuple_typing_subst__doc__, #define TYPEVARTUPLE_TYPING_SUBST_METHODDEF \ {"__typing_subst__", (PyCFunction)typevartuple_typing_subst, METH_O, typevartuple_typing_subst__doc__}, +static PyObject * +typevartuple_typing_subst_impl(typevartupleobject *self, PyObject *arg); + +static PyObject * +typevartuple_typing_subst(PyObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + + return_value = typevartuple_typing_subst_impl((typevartupleobject *)self, arg); + + return return_value; +} + PyDoc_STRVAR(typevartuple_typing_prepare_subst__doc__, "__typing_prepare_subst__($self, alias, args, /)\n" "--\n" @@ -601,7 +656,11 @@ typevartuple_reduce_impl(typevartupleobject *self); static PyObject * typevartuple_reduce(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return typevartuple_reduce_impl((typevartupleobject *)self); + PyObject *return_value = NULL; + + return_value = typevartuple_reduce_impl((typevartupleobject *)self); + + return return_value; } PyDoc_STRVAR(typevartuple_has_default__doc__, @@ -618,7 +677,11 @@ typevartuple_has_default_impl(typevartupleobject *self); static PyObject * typevartuple_has_default(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return typevartuple_has_default_impl((typevartupleobject *)self); + PyObject *return_value = NULL; + + return_value = typevartuple_has_default_impl((typevartupleobject *)self); + + return return_value; } PyDoc_STRVAR(typealias_reduce__doc__, @@ -635,7 +698,11 @@ typealias_reduce_impl(typealiasobject *self); static PyObject * typealias_reduce(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return typealias_reduce_impl((typealiasobject *)self); + PyObject *return_value = NULL; + + return_value = typealias_reduce_impl((typealiasobject *)self); + + return return_value; } PyDoc_STRVAR(typealias_new__doc__, @@ -706,4 +773,4 @@ typealias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=f499d959a942c599 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d3ce5c26c77401c0 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index 99651f3c64bc5a..d81fd2858b6c44 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -24,7 +24,11 @@ EncodingMap_size_impl(struct encoding_map *self); static PyObject * EncodingMap_size(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return EncodingMap_size_impl((struct encoding_map *)self); + PyObject *return_value = NULL; + + return_value = EncodingMap_size_impl((struct encoding_map *)self); + + return return_value; } PyDoc_STRVAR(unicode_title__doc__, @@ -1894,4 +1898,4 @@ unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=db37497bf38a2c17 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5b50c21ec6f9cd28 input=a9049054013a1b77]*/ diff --git a/Objects/dictobject.c b/Objects/dictobject.c index e30d626439e7f8..79ed679b811e6d 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -4234,8 +4234,8 @@ True if the dictionary has the specified key, else False. [clinic start generated code]*/ static PyObject * -dict___contains__(PyDictObject *self, PyObject *key) -/*[clinic end generated code: output=a3d03db709ed6e6b input=fe1cb42ad831e820]*/ +dict___contains___impl(PyDictObject *self, PyObject *key) +/*[clinic end generated code: output=1b314e6da7687dae input=fe1cb42ad831e820]*/ { int contains = PyDict_Contains((PyObject *)self, key); if (contains < 0) { diff --git a/Objects/listobject.c b/Objects/listobject.c index 84faa5a32a1f2a..5b420eb5f9ddd3 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1415,8 +1415,8 @@ Extend list by appending elements from the iterable. [clinic start generated code]*/ static PyObject * -list_extend(PyListObject *self, PyObject *iterable) -/*[clinic end generated code: output=630fb3bca0c8e789 input=979da7597a515791]*/ +list_extend_impl(PyListObject *self, PyObject *iterable) +/*[clinic end generated code: output=b0eba9e0b186d5ce input=979da7597a515791]*/ { if (_list_extend(self, iterable) < 0) { return NULL; @@ -3271,8 +3271,8 @@ Return number of occurrences of value. [clinic start generated code]*/ static PyObject * -list_count(PyListObject *self, PyObject *value) -/*[clinic end generated code: output=b1f5d284205ae714 input=3bdc3a5e6f749565]*/ +list_count_impl(PyListObject *self, PyObject *value) +/*[clinic end generated code: output=eff66f14aef2df86 input=3bdc3a5e6f749565]*/ { Py_ssize_t count = 0; for (Py_ssize_t i = 0; ; i++) { diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index 331363b2babbef..cf673fb379edcd 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -2781,8 +2781,8 @@ Count the number of occurrences of a value. [clinic start generated code]*/ static PyObject * -memoryview_count(PyMemoryViewObject *self, PyObject *value) -/*[clinic end generated code: output=e2c255a8d54eaa12 input=e3036ce1ed7d1823]*/ +memoryview_count_impl(PyMemoryViewObject *self, PyObject *value) +/*[clinic end generated code: output=a15cb19311985063 input=e3036ce1ed7d1823]*/ { PyObject *iter = PyObject_GetIter(_PyObject_CAST(self)); if (iter == NULL) { diff --git a/Objects/setobject.c b/Objects/setobject.c index 1978ae2b165d18..01b0559337cff5 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -1933,8 +1933,8 @@ Update the set, keeping only elements found in either set, but not in both. [clinic start generated code]*/ static PyObject * -set_symmetric_difference_update(PySetObject *so, PyObject *other) -/*[clinic end generated code: output=fbb049c0806028de input=a50acf0365e1f0a5]*/ +set_symmetric_difference_update_impl(PySetObject *so, PyObject *other) +/*[clinic end generated code: output=79f80b4ee5da66c1 input=a50acf0365e1f0a5]*/ { if (Py_Is((PyObject *)so, other)) { return set_clear((PyObject *)so, NULL); diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index b7416a5a1c5372..1b2b53646da6d9 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -604,8 +604,8 @@ Return number of occurrences of value. [clinic start generated code]*/ static PyObject * -tuple_count(PyTupleObject *self, PyObject *value) -/*[clinic end generated code: output=aa927affc5a97605 input=531721aff65bd772]*/ +tuple_count_impl(PyTupleObject *self, PyObject *value) +/*[clinic end generated code: output=cf02888d4bc15d7a input=531721aff65bd772]*/ { Py_ssize_t count = 0; Py_ssize_t i; diff --git a/Objects/typevarobject.c b/Objects/typevarobject.c index d8158293acaabd..9e749e64b44d7c 100644 --- a/Objects/typevarobject.c +++ b/Objects/typevarobject.c @@ -745,8 +745,8 @@ typevar.__typing_subst__ as typevar_typing_subst [clinic start generated code]*/ static PyObject * -typevar_typing_subst(typevarobject *self, PyObject *arg) -/*[clinic end generated code: output=0773735e8ce18968 input=9e87b57f0fc59b92]*/ +typevar_typing_subst_impl(typevarobject *self, PyObject *arg) +/*[clinic end generated code: output=c76ced134ed8f4e1 input=9e87b57f0fc59b92]*/ { PyObject *args[2] = {(PyObject *)self, arg}; PyObject *result = call_typing_func_object("_typevar_subst", args, 2); @@ -1354,8 +1354,8 @@ paramspec.__typing_subst__ as paramspec_typing_subst [clinic start generated code]*/ static PyObject * -paramspec_typing_subst(paramspecobject *self, PyObject *arg) -/*[clinic end generated code: output=4c5b4aaada1c5814 input=2d5b5e3d4a717189]*/ +paramspec_typing_subst_impl(paramspecobject *self, PyObject *arg) +/*[clinic end generated code: output=803e1ade3f13b57d input=2d5b5e3d4a717189]*/ { PyObject *args[2] = {(PyObject *)self, arg}; PyObject *result = call_typing_func_object("_paramspec_subst", args, 2); @@ -1608,8 +1608,8 @@ typevartuple.__typing_subst__ as typevartuple_typing_subst [clinic start generated code]*/ static PyObject * -typevartuple_typing_subst(typevartupleobject *self, PyObject *arg) -/*[clinic end generated code: output=237054c6d7484eea input=3fcf2dfd9eee7945]*/ +typevartuple_typing_subst_impl(typevartupleobject *self, PyObject *arg) +/*[clinic end generated code: output=814316519441cd76 input=3fcf2dfd9eee7945]*/ { PyErr_SetString(PyExc_TypeError, "Substitution of bare TypeVarTuple is not supported"); return NULL; diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index 00fa6a75ec113e..35db5e446735fa 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -28,7 +28,11 @@ winreg_HKEYType_Close_impl(PyHKEYObject *self); static PyObject * winreg_HKEYType_Close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return winreg_HKEYType_Close_impl((PyHKEYObject *)self); + PyObject *return_value = NULL; + + return_value = winreg_HKEYType_Close_impl((PyHKEYObject *)self); + + return return_value; } #endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES)) */ @@ -58,7 +62,11 @@ winreg_HKEYType_Detach_impl(PyHKEYObject *self); static PyObject * winreg_HKEYType_Detach(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return winreg_HKEYType_Detach_impl((PyHKEYObject *)self); + PyObject *return_value = NULL; + + return_value = winreg_HKEYType_Detach_impl((PyHKEYObject *)self); + + return return_value; } #endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES)) */ @@ -1766,4 +1774,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) #ifndef WINREG_QUERYREFLECTIONKEY_METHODDEF #define WINREG_QUERYREFLECTIONKEY_METHODDEF #endif /* !defined(WINREG_QUERYREFLECTIONKEY_METHODDEF) */ -/*[clinic end generated code: output=fbe9b075cd2fa833 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b63cab45ed1e83c6 input=a9049054013a1b77]*/ diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index cc6dc6dfead239..c5455bef59a655 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1303,8 +1303,8 @@ This is guaranteed to be unique among simultaneously existing objects. [clinic start generated code]*/ static PyObject * -builtin_id(PyModuleDef *self, PyObject *v) -/*[clinic end generated code: output=0aa640785f697f65 input=5a534136419631f4]*/ +builtin_id_impl(PyModuleDef *self, PyObject *v) +/*[clinic end generated code: output=4908a6782ed343e9 input=5a534136419631f4]*/ { PyObject *id = PyLong_FromVoidPtr(v); diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index 7d348dbebed385..e5f634e34cb32f 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -628,6 +628,19 @@ PyDoc_STRVAR(builtin_id__doc__, #define BUILTIN_ID_METHODDEF \ {"id", (PyCFunction)builtin_id, METH_O, builtin_id__doc__}, +static PyObject * +builtin_id_impl(PyModuleDef *self, PyObject *v); + +static PyObject * +builtin_id(PyObject *self, PyObject *v) +{ + PyObject *return_value = NULL; + + return_value = builtin_id_impl((PyModuleDef *)self, v); + + return return_value; +} + PyDoc_STRVAR(builtin_setattr__doc__, "setattr($module, obj, name, value, /)\n" "--\n" @@ -1239,4 +1252,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=b0178189d13e8bf8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c08e0e086a791ff0 input=a9049054013a1b77]*/ diff --git a/Python/clinic/context.c.h b/Python/clinic/context.c.h index 0adde76d7c3cb1..128482abc1b981 100644 --- a/Python/clinic/context.c.h +++ b/Python/clinic/context.c.h @@ -59,7 +59,11 @@ _contextvars_Context_items_impl(PyContext *self); static PyObject * _contextvars_Context_items(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _contextvars_Context_items_impl((PyContext *)self); + PyObject *return_value = NULL; + + return_value = _contextvars_Context_items_impl((PyContext *)self); + + return return_value; } PyDoc_STRVAR(_contextvars_Context_keys__doc__, @@ -77,7 +81,11 @@ _contextvars_Context_keys_impl(PyContext *self); static PyObject * _contextvars_Context_keys(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _contextvars_Context_keys_impl((PyContext *)self); + PyObject *return_value = NULL; + + return_value = _contextvars_Context_keys_impl((PyContext *)self); + + return return_value; } PyDoc_STRVAR(_contextvars_Context_values__doc__, @@ -95,7 +103,11 @@ _contextvars_Context_values_impl(PyContext *self); static PyObject * _contextvars_Context_values(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _contextvars_Context_values_impl((PyContext *)self); + PyObject *return_value = NULL; + + return_value = _contextvars_Context_values_impl((PyContext *)self); + + return return_value; } PyDoc_STRVAR(_contextvars_Context_copy__doc__, @@ -113,7 +125,11 @@ _contextvars_Context_copy_impl(PyContext *self); static PyObject * _contextvars_Context_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _contextvars_Context_copy_impl((PyContext *)self); + PyObject *return_value = NULL; + + return_value = _contextvars_Context_copy_impl((PyContext *)self); + + return return_value; } PyDoc_STRVAR(_contextvars_ContextVar_get__doc__, @@ -168,6 +184,19 @@ PyDoc_STRVAR(_contextvars_ContextVar_set__doc__, #define _CONTEXTVARS_CONTEXTVAR_SET_METHODDEF \ {"set", (PyCFunction)_contextvars_ContextVar_set, METH_O, _contextvars_ContextVar_set__doc__}, +static PyObject * +_contextvars_ContextVar_set_impl(PyContextVar *self, PyObject *value); + +static PyObject * +_contextvars_ContextVar_set(PyObject *self, PyObject *value) +{ + PyObject *return_value = NULL; + + return_value = _contextvars_ContextVar_set_impl((PyContextVar *)self, value); + + return return_value; +} + PyDoc_STRVAR(_contextvars_ContextVar_reset__doc__, "reset($self, token, /)\n" "--\n" @@ -180,6 +209,19 @@ PyDoc_STRVAR(_contextvars_ContextVar_reset__doc__, #define _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF \ {"reset", (PyCFunction)_contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__}, +static PyObject * +_contextvars_ContextVar_reset_impl(PyContextVar *self, PyObject *token); + +static PyObject * +_contextvars_ContextVar_reset(PyObject *self, PyObject *token) +{ + PyObject *return_value = NULL; + + return_value = _contextvars_ContextVar_reset_impl((PyContextVar *)self, token); + + return return_value; +} + PyDoc_STRVAR(token_enter__doc__, "__enter__($self, /)\n" "--\n" @@ -195,7 +237,11 @@ token_enter_impl(PyContextToken *self); static PyObject * token_enter(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return token_enter_impl((PyContextToken *)self); + PyObject *return_value = NULL; + + return_value = token_enter_impl((PyContextToken *)self); + + return return_value; } PyDoc_STRVAR(token_exit__doc__, @@ -230,4 +276,4 @@ token_exit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=01987cdbf68a951a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=65cc35e46da68d51 input=a9049054013a1b77]*/ diff --git a/Python/clinic/instruction_sequence.c.h b/Python/clinic/instruction_sequence.c.h index 41ab2de44e426e..a5c49b7daea7d0 100644 --- a/Python/clinic/instruction_sequence.c.h +++ b/Python/clinic/instruction_sequence.c.h @@ -284,7 +284,11 @@ InstructionSequenceType_get_nested_impl(_PyInstructionSequence *self); static PyObject * InstructionSequenceType_get_nested(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return InstructionSequenceType_get_nested_impl((_PyInstructionSequence *)self); + PyObject *return_value = NULL; + + return_value = InstructionSequenceType_get_nested_impl((_PyInstructionSequence *)self); + + return return_value; } PyDoc_STRVAR(InstructionSequenceType_get_instructions__doc__, @@ -302,6 +306,10 @@ InstructionSequenceType_get_instructions_impl(_PyInstructionSequence *self); static PyObject * InstructionSequenceType_get_instructions(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return InstructionSequenceType_get_instructions_impl((_PyInstructionSequence *)self); + PyObject *return_value = NULL; + + return_value = InstructionSequenceType_get_instructions_impl((_PyInstructionSequence *)self); + + return return_value; } -/*[clinic end generated code: output=e6b5d05bde008cc2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fb0f15c2a0805a72 input=a9049054013a1b77]*/ diff --git a/Python/context.c b/Python/context.c index dfdde7d1fa723f..4110e6891a1070 100644 --- a/Python/context.c +++ b/Python/context.c @@ -1058,8 +1058,8 @@ value via the `ContextVar.reset()` method. [clinic start generated code]*/ static PyObject * -_contextvars_ContextVar_set(PyContextVar *self, PyObject *value) -/*[clinic end generated code: output=446ed5e820d6d60b input=c0a6887154227453]*/ +_contextvars_ContextVar_set_impl(PyContextVar *self, PyObject *value) +/*[clinic end generated code: output=1b562d35cc79c806 input=c0a6887154227453]*/ { return PyContextVar_Set((PyObject *)self, value); } @@ -1076,8 +1076,8 @@ created the token was used. [clinic start generated code]*/ static PyObject * -_contextvars_ContextVar_reset(PyContextVar *self, PyObject *token) -/*[clinic end generated code: output=d4ee34d0742d62ee input=ebe2881e5af4ffda]*/ +_contextvars_ContextVar_reset_impl(PyContextVar *self, PyObject *token) +/*[clinic end generated code: output=3205d2bdff568521 input=ebe2881e5af4ffda]*/ { if (!PyContextToken_CheckExact(token)) { PyErr_Format(PyExc_TypeError, From a09a5fe9796fa745db7387ef1871818b249d4df6 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 28 Feb 2025 12:12:49 +0100 Subject: [PATCH 3/9] Manual fix: use _impl() functions --- Modules/_collectionsmodule.c | 4 ++-- Modules/_io/bufferedio.c | 2 +- Modules/_io/bytesio.c | 4 ++-- Modules/_struct.c | 2 +- Objects/listobject.c | 2 +- Objects/setobject.c | 16 ++++++++-------- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index b2173d86445cc4..a6c58c623a838d 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -484,7 +484,7 @@ deque_extend_impl(dequeobject *deque, PyObject *iterable) PyObject *s = PySequence_List(iterable); if (s == NULL) return NULL; - result = deque_extend(deque, s); + result = deque_extend_impl(deque, s); Py_DECREF(s); return result; } @@ -578,7 +578,7 @@ deque_inplace_concat(PyObject *self, PyObject *other) PyObject *result; // deque_extend is thread-safe - result = deque_extend(deque, other); + result = deque_extend_impl(deque, other); if (result == NULL) return result; Py_INCREF(deque); diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 44bc1af593b512..d0fac888ca8bd3 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -560,7 +560,7 @@ _io__Buffered_close_impl(buffered *self) } if (self->finalizing) { - PyObject *r = _io__Buffered__dealloc_warn(self, (PyObject *) self); + PyObject *r = _io__Buffered__dealloc_warn_impl(self, (PyObject *) self); if (r) Py_DECREF(r); else diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index 6097d2817531aa..e45a2d1a16dcba 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -842,7 +842,7 @@ bytesio_setstate(PyObject *op, PyObject *state) /* Set the value of the internal buffer. If state[0] does not support the buffer protocol, bytesio_write will raise the appropriate TypeError. */ - result = _io_BytesIO_write(self, PyTuple_GET_ITEM(state, 0)); + result = _io_BytesIO_write_impl(self, PyTuple_GET_ITEM(state, 0)); if (result == NULL) return NULL; Py_DECREF(result); @@ -958,7 +958,7 @@ _io_BytesIO___init___impl(bytesio *self, PyObject *initvalue) } else { PyObject *res; - res = _io_BytesIO_write(self, initvalue); + res = _io_BytesIO_write_impl(self, initvalue); if (res == NULL) return -1; Py_DECREF(res); diff --git a/Modules/_struct.c b/Modules/_struct.c index 0be71905d277ee..b86bccc71c33fc 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -2691,7 +2691,7 @@ iter_unpack_impl(PyObject *module, PyStructObject *s_object, PyObject *buffer) /*[clinic end generated code: output=0ae50e250d20e74d input=b214a58869a3c98d]*/ { - return Struct_iter_unpack(s_object, buffer); + return Struct_iter_unpack_impl(s_object, buffer); } static struct PyMethodDef module_functions[] = { diff --git a/Objects/listobject.c b/Objects/listobject.c index 5b420eb5f9ddd3..1a19c6cb42b07f 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1427,7 +1427,7 @@ list_extend_impl(PyListObject *self, PyObject *iterable) PyObject * _PyList_Extend(PyListObject *self, PyObject *iterable) { - return list_extend(self, iterable); + return list_extend_impl(self, iterable); } int diff --git a/Objects/setobject.c b/Objects/setobject.c index 01b0559337cff5..69d24b0a664ba7 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -2004,7 +2004,7 @@ set_xor(PyObject *self, PyObject *other) if (!PyAnySet_Check(self) || !PyAnySet_Check(other)) Py_RETURN_NOTIMPLEMENTED; PySetObject *so = _PySet_CAST(self); - return set_symmetric_difference(so, other); + return set_symmetric_difference_impl(so, other); } static PyObject * @@ -2016,7 +2016,7 @@ set_ixor(PyObject *self, PyObject *other) Py_RETURN_NOTIMPLEMENTED; PySetObject *so = _PySet_CAST(self); - result = set_symmetric_difference_update(so, other); + result = set_symmetric_difference_update_impl(so, other); if (result == NULL) return NULL; Py_DECREF(result); @@ -2083,7 +2083,7 @@ set_issuperset_impl(PySetObject *so, PyObject *other) /*[clinic end generated code: output=ecf00ce552c09461 input=5f2e1f262e6e4ccc]*/ { if (PyAnySet_Check(other)) { - return set_issubset((PySetObject *)other, (PyObject *)so); + return set_issubset_impl((PySetObject *)other, (PyObject *)so); } PyObject *key, *it = PyObject_GetIter(other); @@ -2127,7 +2127,7 @@ set_richcompare(PyObject *self, PyObject *w, int op) ((PySetObject *)w)->hash != -1 && v->hash != ((PySetObject *)w)->hash) Py_RETURN_FALSE; - return set_issubset(v, w); + return set_issubset_impl(v, w); case Py_NE: r1 = set_richcompare((PyObject*)v, w, Py_EQ); if (r1 == NULL) @@ -2138,17 +2138,17 @@ set_richcompare(PyObject *self, PyObject *w, int op) return NULL; return PyBool_FromLong(!r2); case Py_LE: - return set_issubset(v, w); + return set_issubset_impl(v, w); case Py_GE: - return set_issuperset(v, w); + return set_issuperset_impl(v, w); case Py_LT: if (PySet_GET_SIZE(v) >= PySet_GET_SIZE(w)) Py_RETURN_FALSE; - return set_issubset(v, w); + return set_issubset_impl(v, w); case Py_GT: if (PySet_GET_SIZE(v) <= PySet_GET_SIZE(w)) Py_RETURN_FALSE; - return set_issuperset(v, w); + return set_issuperset_impl(v, w); } Py_RETURN_NOTIMPLEMENTED; } From a0461fe58baba41188b025c75ce15a57c7de8aa9 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 28 Feb 2025 12:35:43 +0100 Subject: [PATCH 4/9] Please mypy gods --- Tools/clinic/libclinic/converters.py | 2 ++ Tools/clinic/libclinic/parse_args.py | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Tools/clinic/libclinic/converters.py b/Tools/clinic/libclinic/converters.py index 2998eb519648aa..29828c08af07b1 100644 --- a/Tools/clinic/libclinic/converters.py +++ b/Tools/clinic/libclinic/converters.py @@ -60,6 +60,7 @@ class defining_class_converter(CConverter): type = 'PyTypeObject *' format_unit = '' show_in_signature = False + specified_type: str | None = None def converter_init(self, *, type: str | None = None) -> None: self.specified_type = type @@ -1126,6 +1127,7 @@ class self_converter(CConverter): """ type: str | None = None format_unit = '' + specified_type: str | None = None def converter_init(self, *, type: str | None = None) -> None: self.specified_type = type diff --git a/Tools/clinic/libclinic/parse_args.py b/Tools/clinic/libclinic/parse_args.py index 0e090544c65bf1..56616eccd7cc9b 100644 --- a/Tools/clinic/libclinic/parse_args.py +++ b/Tools/clinic/libclinic/parse_args.py @@ -195,7 +195,7 @@ class ParseArgsCodeGen: # Function parameters parameters: list[Parameter] - self_parameter: Parameter + self_parameter_converter: self_converter converters: list[CConverter] # Is 'defining_class' used for the first parameter? @@ -237,9 +237,10 @@ def __init__(self, func: Function, codegen: CodeGen) -> None: self.codegen = codegen self.parameters = list(self.func.parameters.values()) - self.self_parameter = self.parameters.pop(0) - if not isinstance(self.self_parameter.converter, self_converter): + self_parameter = self.parameters.pop(0) + if not isinstance(self_parameter.converter, self_converter): raise ValueError("the first parameter must use self_converter") + self.self_parameter_converter = self_parameter.converter self.requires_defining_class = False if self.parameters and isinstance(self.parameters[0].converter, defining_class_converter): @@ -294,8 +295,8 @@ def use_simple_return(self) -> bool: pyobject = 'PyObject *' return (self.func.return_converter.type == pyobject and not self.func.critical_section - and self.self_parameter.converter.type in (pyobject, None) - and self.self_parameter.converter.specified_type in (pyobject, None)) + and self.self_parameter_converter.type in (pyobject, None) + and self.self_parameter_converter.specified_type in (pyobject, None)) def select_prototypes(self) -> None: self.docstring_prototype = '' From 9dda479d7b9c1945c17a4b2507c7425b06b023a6 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 28 Feb 2025 16:00:02 +0100 Subject: [PATCH 5/9] Update clinic tests --- Lib/test/clinic.test.c | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/Lib/test/clinic.test.c b/Lib/test/clinic.test.c index 64f326903c9afd..41b05905589294 100644 --- a/Lib/test/clinic.test.c +++ b/Lib/test/clinic.test.c @@ -4910,16 +4910,21 @@ Test_cls_no_params_impl(TestObj *self, PyTypeObject *cls); static PyObject * Test_cls_no_params(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + PyObject *return_value = NULL; + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "cls_no_params() takes no arguments"); - return NULL; + goto exit; } - return Test_cls_no_params_impl((TestObj *)self, cls); + return_value = Test_cls_no_params_impl((TestObj *)self, cls); + +exit: + return return_value; } static PyObject * Test_cls_no_params_impl(TestObj *self, PyTypeObject *cls) -/*[clinic end generated code: output=8845de054449f40a input=e7e2e4e344e96a11]*/ +/*[clinic end generated code: output=70c0b4bfb2ea3bab input=e7e2e4e344e96a11]*/ /*[clinic input] @@ -4940,7 +4945,7 @@ static int Test_metho_not_default_return_converter_impl(TestObj *self, PyObject *a); static PyObject * -Test_metho_not_default_return_converter(TestObj *self, PyObject *a) +Test_metho_not_default_return_converter(PyObject *self, PyObject *a) { PyObject *return_value = NULL; int _return_value; @@ -4957,7 +4962,7 @@ Test_metho_not_default_return_converter(TestObj *self, PyObject *a) static int Test_metho_not_default_return_converter_impl(TestObj *self, PyObject *a) -/*[clinic end generated code: output=b2cce75a7af2e6ce input=428657129b521177]*/ +/*[clinic end generated code: output=8b03f5213c312138 input=428657129b521177]*/ /*[clinic input] @@ -5291,12 +5296,16 @@ Test_meth_coexist_impl(TestObj *self); static PyObject * Test_meth_coexist(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return Test_meth_coexist_impl((TestObj *)self); + PyObject *return_value = NULL; + + return_value = Test_meth_coexist_impl((TestObj *)self); + + return return_value; } static PyObject * Test_meth_coexist_impl(TestObj *self) -/*[clinic end generated code: output=7edf4e95b29f06fa input=2a1d75b5e6fec6dd]*/ +/*[clinic end generated code: output=09e0fbba4ffb08df input=2a1d75b5e6fec6dd]*/ /*[clinic input] @getter @@ -5319,12 +5328,16 @@ Test_property_get_impl(TestObj *self); static PyObject * Test_property_get(PyObject *self, void *Py_UNUSED(context)) { - return Test_property_get_impl((TestObj *)self); + PyObject *return_value = NULL; + + return_value = Test_property_get_impl((TestObj *)self); + + return return_value; } static PyObject * Test_property_get_impl(TestObj *self) -/*[clinic end generated code: output=b38d68abd3466a6e input=2d92b3449fbc7d2b]*/ +/*[clinic end generated code: output=117f470c76def2b0 input=2d92b3449fbc7d2b]*/ /*[clinic input] @setter @@ -5420,12 +5433,16 @@ Test_setter_first_with_docstr_get_impl(TestObj *self); static PyObject * Test_setter_first_with_docstr_get(PyObject *self, void *Py_UNUSED(context)) { - return Test_setter_first_with_docstr_get_impl((TestObj *)self); + PyObject *return_value = NULL; + + return_value = Test_setter_first_with_docstr_get_impl((TestObj *)self); + + return return_value; } static PyObject * Test_setter_first_with_docstr_get_impl(TestObj *self) -/*[clinic end generated code: output=fe6e3aa844a24920 input=10af4e43b3cb34dc]*/ +/*[clinic end generated code: output=ee74b65390f451f6 input=10af4e43b3cb34dc]*/ /*[clinic input] output push From 2fb1cfa1dd0dd5bfcc97b20e60cba53c9f3f8a3f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 7 Mar 2025 17:11:00 +0100 Subject: [PATCH 6/9] Eat one space --- Modules/_io/bufferedio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index d0fac888ca8bd3..06a5afc52559c3 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -560,7 +560,7 @@ _io__Buffered_close_impl(buffered *self) } if (self->finalizing) { - PyObject *r = _io__Buffered__dealloc_warn_impl(self, (PyObject *) self); + PyObject *r = _io__Buffered__dealloc_warn_impl(self, (PyObject *)self); if (r) Py_DECREF(r); else From 200660384af5117cb3f6f40430d93a889a3edb7e Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 7 Mar 2025 17:21:52 +0100 Subject: [PATCH 7/9] Fix manual changes --- Modules/_collectionsmodule.c | 4 ++-- Modules/_struct.c | 2 +- Objects/listobject.c | 2 +- Objects/setobject.c | 16 ++++++++-------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index a6c58c623a838d..ad670293ec5b6a 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -484,7 +484,7 @@ deque_extend_impl(dequeobject *deque, PyObject *iterable) PyObject *s = PySequence_List(iterable); if (s == NULL) return NULL; - result = deque_extend_impl(deque, s); + result = deque_extend((PyObject*)deque, s); Py_DECREF(s); return result; } @@ -578,7 +578,7 @@ deque_inplace_concat(PyObject *self, PyObject *other) PyObject *result; // deque_extend is thread-safe - result = deque_extend_impl(deque, other); + result = deque_extend((PyObject*)deque, other); if (result == NULL) return result; Py_INCREF(deque); diff --git a/Modules/_struct.c b/Modules/_struct.c index b86bccc71c33fc..f04805d9d6d1d7 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -2691,7 +2691,7 @@ iter_unpack_impl(PyObject *module, PyStructObject *s_object, PyObject *buffer) /*[clinic end generated code: output=0ae50e250d20e74d input=b214a58869a3c98d]*/ { - return Struct_iter_unpack_impl(s_object, buffer); + return Struct_iter_unpack((PyObject*)s_object, buffer); } static struct PyMethodDef module_functions[] = { diff --git a/Objects/listobject.c b/Objects/listobject.c index c4a9b41bbfad42..4ad2b032f64c62 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1428,7 +1428,7 @@ list_extend_impl(PyListObject *self, PyObject *iterable) PyObject * _PyList_Extend(PyListObject *self, PyObject *iterable) { - return list_extend_impl(self, iterable); + return list_extend((PyObject*)self, iterable); } int diff --git a/Objects/setobject.c b/Objects/setobject.c index 69d24b0a664ba7..27b370e8e4fb05 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -2004,7 +2004,7 @@ set_xor(PyObject *self, PyObject *other) if (!PyAnySet_Check(self) || !PyAnySet_Check(other)) Py_RETURN_NOTIMPLEMENTED; PySetObject *so = _PySet_CAST(self); - return set_symmetric_difference_impl(so, other); + return set_symmetric_difference((PyObject*)so, other); } static PyObject * @@ -2016,7 +2016,7 @@ set_ixor(PyObject *self, PyObject *other) Py_RETURN_NOTIMPLEMENTED; PySetObject *so = _PySet_CAST(self); - result = set_symmetric_difference_update_impl(so, other); + result = set_symmetric_difference_update((PyObject*)so, other); if (result == NULL) return NULL; Py_DECREF(result); @@ -2083,7 +2083,7 @@ set_issuperset_impl(PySetObject *so, PyObject *other) /*[clinic end generated code: output=ecf00ce552c09461 input=5f2e1f262e6e4ccc]*/ { if (PyAnySet_Check(other)) { - return set_issubset_impl((PySetObject *)other, (PyObject *)so); + return set_issubset(other, (PyObject *)so); } PyObject *key, *it = PyObject_GetIter(other); @@ -2127,7 +2127,7 @@ set_richcompare(PyObject *self, PyObject *w, int op) ((PySetObject *)w)->hash != -1 && v->hash != ((PySetObject *)w)->hash) Py_RETURN_FALSE; - return set_issubset_impl(v, w); + return set_issubset((PyObject*)v, w); case Py_NE: r1 = set_richcompare((PyObject*)v, w, Py_EQ); if (r1 == NULL) @@ -2138,17 +2138,17 @@ set_richcompare(PyObject *self, PyObject *w, int op) return NULL; return PyBool_FromLong(!r2); case Py_LE: - return set_issubset_impl(v, w); + return set_issubset((PyObject*)v, w); case Py_GE: - return set_issuperset_impl(v, w); + return set_issuperset((PyObject*)v, w); case Py_LT: if (PySet_GET_SIZE(v) >= PySet_GET_SIZE(w)) Py_RETURN_FALSE; - return set_issubset_impl(v, w); + return set_issubset((PyObject*)v, w); case Py_GT: if (PySet_GET_SIZE(v) <= PySet_GET_SIZE(w)) Py_RETURN_FALSE; - return set_issuperset_impl(v, w); + return set_issuperset((PyObject*)v, w); } Py_RETURN_NOTIMPLEMENTED; } From 07d1fc38811874ab6dce6983ba87ba76f351c2a9 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 10 Mar 2025 17:15:43 +0100 Subject: [PATCH 8/9] Simplify --- Modules/_io/clinic/bytesio.c.h | 59 +++------------ Modules/_io/clinic/fileio.c.h | 53 +++----------- Modules/_io/clinic/textio.c.h | 14 +--- Modules/_io/clinic/winconsoleio.c.h | 41 +++-------- Modules/_multiprocessing/clinic/semaphore.c.h | 26 ++----- Modules/_sqlite/clinic/blob.c.h | 20 ++---- Modules/_sqlite/clinic/connection.c.h | 32 ++------- Modules/_sqlite/clinic/cursor.c.h | 20 ++---- Modules/_sqlite/clinic/row.c.h | 8 +-- Modules/_sre/clinic/sre.c.h | 32 ++------- Modules/_ssl/clinic/cert.c.h | 8 +-- Modules/cjkcodecs/clinic/multibytecodec.c.h | 41 +++-------- Modules/clinic/_asynciomodule.c.h | 8 +-- Modules/clinic/_bz2module.c.h | 8 +-- Modules/clinic/_collectionsmodule.c.h | 14 +--- Modules/clinic/_curses_panel.c.h | 71 ++++--------------- Modules/clinic/_cursesmodule.c.h | 8 +-- Modules/clinic/_dbmmodule.c.h | 26 ++----- Modules/clinic/_elementtree.c.h | 62 ++++------------ Modules/clinic/_gdbmmodule.c.h | 53 ++++---------- Modules/clinic/_hashopenssl.c.h | 38 ++-------- Modules/clinic/_lsprof.c.h | 23 ++---- Modules/clinic/_lzmamodule.c.h | 8 +-- Modules/clinic/_pickle.c.h | 53 +++----------- Modules/clinic/_ssl.c.h | 8 +-- Modules/clinic/_testmultiphase.c.h | 29 ++------ Modules/clinic/_tkinter.c.h | 38 ++-------- Modules/clinic/_winapi.c.h | 14 +--- Modules/clinic/arraymodule.c.h | 65 ++++------------- Modules/clinic/blake2module.c.h | 20 ++---- Modules/clinic/md5module.c.h | 23 ++---- Modules/clinic/overlapped.c.h | 8 +-- Modules/clinic/posixmodule.c.h | 14 +--- Modules/clinic/pyexpat.c.h | 20 ++---- Modules/clinic/selectmodule.c.h | 20 ++---- Modules/clinic/sha1module.c.h | 23 ++---- Modules/clinic/sha2module.c.h | 44 +++--------- Modules/clinic/sha3module.c.h | 20 ++---- Modules/clinic/socketmodule.c.h | 8 +-- Modules/clinic/zlibmodule.c.h | 38 +++------- Objects/clinic/bytearrayobject.c.h | 14 +--- Objects/clinic/bytesobject.c.h | 8 +-- Objects/clinic/classobject.c.h | 8 +-- Objects/clinic/complexobject.c.h | 20 ++---- Objects/clinic/dictobject.c.h | 44 +++--------- Objects/clinic/listobject.c.h | 14 +--- Objects/clinic/memoryobject.c.h | 20 ++---- Objects/clinic/tupleobject.c.h | 8 +-- Objects/clinic/typeobject.c.h | 26 ++----- Objects/clinic/typevarobject.c.h | 44 +++--------- Objects/clinic/unicodeobject.c.h | 8 +-- PC/clinic/winreg.c.h | 14 +--- Python/clinic/context.c.h | 32 ++------- Python/clinic/instruction_sequence.c.h | 14 +--- Tools/clinic/libclinic/parse_args.py | 14 ++-- 55 files changed, 293 insertions(+), 1113 deletions(-) diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index 987cf3ba3e5662..dc481603d1e8a2 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -24,11 +24,7 @@ _io_BytesIO_readable_impl(bytesio *self); static PyObject * _io_BytesIO_readable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_BytesIO_readable_impl((bytesio *)self); - - return return_value; + return _io_BytesIO_readable_impl((bytesio *)self); } PyDoc_STRVAR(_io_BytesIO_writable__doc__, @@ -46,11 +42,7 @@ _io_BytesIO_writable_impl(bytesio *self); static PyObject * _io_BytesIO_writable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_BytesIO_writable_impl((bytesio *)self); - - return return_value; + return _io_BytesIO_writable_impl((bytesio *)self); } PyDoc_STRVAR(_io_BytesIO_seekable__doc__, @@ -68,11 +60,7 @@ _io_BytesIO_seekable_impl(bytesio *self); static PyObject * _io_BytesIO_seekable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_BytesIO_seekable_impl((bytesio *)self); - - return return_value; + return _io_BytesIO_seekable_impl((bytesio *)self); } PyDoc_STRVAR(_io_BytesIO_flush__doc__, @@ -90,11 +78,7 @@ _io_BytesIO_flush_impl(bytesio *self); static PyObject * _io_BytesIO_flush(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_BytesIO_flush_impl((bytesio *)self); - - return return_value; + return _io_BytesIO_flush_impl((bytesio *)self); } PyDoc_STRVAR(_io_BytesIO_getbuffer__doc__, @@ -112,16 +96,11 @@ _io_BytesIO_getbuffer_impl(bytesio *self, PyTypeObject *cls); static PyObject * _io_BytesIO_getbuffer(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "getbuffer() takes no arguments"); - goto exit; + return NULL; } - return_value = _io_BytesIO_getbuffer_impl((bytesio *)self, cls); - -exit: - return return_value; + return _io_BytesIO_getbuffer_impl((bytesio *)self, cls); } PyDoc_STRVAR(_io_BytesIO_getvalue__doc__, @@ -139,11 +118,7 @@ _io_BytesIO_getvalue_impl(bytesio *self); static PyObject * _io_BytesIO_getvalue(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_BytesIO_getvalue_impl((bytesio *)self); - - return return_value; + return _io_BytesIO_getvalue_impl((bytesio *)self); } PyDoc_STRVAR(_io_BytesIO_isatty__doc__, @@ -163,11 +138,7 @@ _io_BytesIO_isatty_impl(bytesio *self); static PyObject * _io_BytesIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_BytesIO_isatty_impl((bytesio *)self); - - return return_value; + return _io_BytesIO_isatty_impl((bytesio *)self); } PyDoc_STRVAR(_io_BytesIO_tell__doc__, @@ -185,11 +156,7 @@ _io_BytesIO_tell_impl(bytesio *self); static PyObject * _io_BytesIO_tell(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_BytesIO_tell_impl((bytesio *)self); - - return return_value; + return _io_BytesIO_tell_impl((bytesio *)self); } PyDoc_STRVAR(_io_BytesIO_read__doc__, @@ -532,11 +499,7 @@ _io_BytesIO_close_impl(bytesio *self); static PyObject * _io_BytesIO_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_BytesIO_close_impl((bytesio *)self); - - return return_value; + return _io_BytesIO_close_impl((bytesio *)self); } PyDoc_STRVAR(_io_BytesIO___init____doc__, @@ -598,4 +561,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=81a64e1ff7660977 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=477217b2bc464110 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index f68cda18cf2803..bc816ea030fc80 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -27,16 +27,11 @@ _io_FileIO_close_impl(fileio *self, PyTypeObject *cls); static PyObject * _io_FileIO_close(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "close() takes no arguments"); - goto exit; + return NULL; } - return_value = _io_FileIO_close_impl((fileio *)self, cls); - -exit: - return return_value; + return _io_FileIO_close_impl((fileio *)self, cls); } PyDoc_STRVAR(_io_FileIO___init____doc__, @@ -158,11 +153,7 @@ _io_FileIO_fileno_impl(fileio *self); static PyObject * _io_FileIO_fileno(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_FileIO_fileno_impl((fileio *)self); - - return return_value; + return _io_FileIO_fileno_impl((fileio *)self); } PyDoc_STRVAR(_io_FileIO_readable__doc__, @@ -180,11 +171,7 @@ _io_FileIO_readable_impl(fileio *self); static PyObject * _io_FileIO_readable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_FileIO_readable_impl((fileio *)self); - - return return_value; + return _io_FileIO_readable_impl((fileio *)self); } PyDoc_STRVAR(_io_FileIO_writable__doc__, @@ -202,11 +189,7 @@ _io_FileIO_writable_impl(fileio *self); static PyObject * _io_FileIO_writable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_FileIO_writable_impl((fileio *)self); - - return return_value; + return _io_FileIO_writable_impl((fileio *)self); } PyDoc_STRVAR(_io_FileIO_seekable__doc__, @@ -224,11 +207,7 @@ _io_FileIO_seekable_impl(fileio *self); static PyObject * _io_FileIO_seekable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_FileIO_seekable_impl((fileio *)self); - - return return_value; + return _io_FileIO_seekable_impl((fileio *)self); } PyDoc_STRVAR(_io_FileIO_readinto__doc__, @@ -304,11 +283,7 @@ _io_FileIO_readall_impl(fileio *self); static PyObject * _io_FileIO_readall(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_FileIO_readall_impl((fileio *)self); - - return return_value; + return _io_FileIO_readall_impl((fileio *)self); } PyDoc_STRVAR(_io_FileIO_read__doc__, @@ -487,11 +462,7 @@ _io_FileIO_tell_impl(fileio *self); static PyObject * _io_FileIO_tell(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_FileIO_tell_impl((fileio *)self); - - return return_value; + return _io_FileIO_tell_impl((fileio *)self); } #if defined(HAVE_FTRUNCATE) @@ -564,14 +535,10 @@ _io_FileIO_isatty_impl(fileio *self); static PyObject * _io_FileIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_FileIO_isatty_impl((fileio *)self); - - return return_value; + return _io_FileIO_isatty_impl((fileio *)self); } #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=39603a266edc0f97 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f4e1f74c03d4ecdf input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index 9be58de9aa732f..fd84198b1036de 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -446,11 +446,7 @@ _io_IncrementalNewlineDecoder_getstate_impl(nldecoder_object *self); static PyObject * _io_IncrementalNewlineDecoder_getstate(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_IncrementalNewlineDecoder_getstate_impl((nldecoder_object *)self); - - return return_value; + return _io_IncrementalNewlineDecoder_getstate_impl((nldecoder_object *)self); } PyDoc_STRVAR(_io_IncrementalNewlineDecoder_setstate__doc__, @@ -489,11 +485,7 @@ _io_IncrementalNewlineDecoder_reset_impl(nldecoder_object *self); static PyObject * _io_IncrementalNewlineDecoder_reset(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io_IncrementalNewlineDecoder_reset_impl((nldecoder_object *)self); - - return return_value; + return _io_IncrementalNewlineDecoder_reset_impl((nldecoder_object *)self); } PyDoc_STRVAR(_io_TextIOWrapper___init____doc__, @@ -1312,4 +1304,4 @@ _io_TextIOWrapper__CHUNK_SIZE_set(PyObject *self, PyObject *value, void *Py_UNUS return return_value; } -/*[clinic end generated code: output=83429aa3b618a83d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dad68d8c33d676e6 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h index 95f4757cbe39b3..ba6dcde6e01064 100644 --- a/Modules/_io/clinic/winconsoleio.c.h +++ b/Modules/_io/clinic/winconsoleio.c.h @@ -29,16 +29,11 @@ _io__WindowsConsoleIO_close_impl(winconsoleio *self, PyTypeObject *cls); static PyObject * _io__WindowsConsoleIO_close(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "close() takes no arguments"); - goto exit; + return NULL; } - return_value = _io__WindowsConsoleIO_close_impl((winconsoleio *)self, cls); - -exit: - return return_value; + return _io__WindowsConsoleIO_close_impl((winconsoleio *)self, cls); } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -161,11 +156,7 @@ _io__WindowsConsoleIO_fileno_impl(winconsoleio *self); static PyObject * _io__WindowsConsoleIO_fileno(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io__WindowsConsoleIO_fileno_impl((winconsoleio *)self); - - return return_value; + return _io__WindowsConsoleIO_fileno_impl((winconsoleio *)self); } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -187,11 +178,7 @@ _io__WindowsConsoleIO_readable_impl(winconsoleio *self); static PyObject * _io__WindowsConsoleIO_readable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io__WindowsConsoleIO_readable_impl((winconsoleio *)self); - - return return_value; + return _io__WindowsConsoleIO_readable_impl((winconsoleio *)self); } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -213,11 +200,7 @@ _io__WindowsConsoleIO_writable_impl(winconsoleio *self); static PyObject * _io__WindowsConsoleIO_writable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io__WindowsConsoleIO_writable_impl((winconsoleio *)self); - - return return_value; + return _io__WindowsConsoleIO_writable_impl((winconsoleio *)self); } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -298,11 +281,7 @@ _io__WindowsConsoleIO_readall_impl(winconsoleio *self); static PyObject * _io__WindowsConsoleIO_readall(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io__WindowsConsoleIO_readall_impl((winconsoleio *)self); - - return return_value; + return _io__WindowsConsoleIO_readall_impl((winconsoleio *)self); } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -442,11 +421,7 @@ _io__WindowsConsoleIO_isatty_impl(winconsoleio *self); static PyObject * _io__WindowsConsoleIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _io__WindowsConsoleIO_isatty_impl((winconsoleio *)self); - - return return_value; + return _io__WindowsConsoleIO_isatty_impl((winconsoleio *)self); } #endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */ @@ -486,4 +461,4 @@ _io__WindowsConsoleIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=df1b04a95695734c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=edc47f5c49589045 input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/semaphore.c.h b/Modules/_multiprocessing/clinic/semaphore.c.h index e6382e4b56cae3..e789137ec1e013 100644 --- a/Modules/_multiprocessing/clinic/semaphore.c.h +++ b/Modules/_multiprocessing/clinic/semaphore.c.h @@ -388,11 +388,7 @@ _multiprocessing_SemLock__is_mine_impl(SemLockObject *self); static PyObject * _multiprocessing_SemLock__is_mine(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _multiprocessing_SemLock__is_mine_impl((SemLockObject *)self); - - return return_value; + return _multiprocessing_SemLock__is_mine_impl((SemLockObject *)self); } #endif /* defined(HAVE_MP_SEMAPHORE) */ @@ -414,11 +410,7 @@ _multiprocessing_SemLock__get_value_impl(SemLockObject *self); static PyObject * _multiprocessing_SemLock__get_value(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _multiprocessing_SemLock__get_value_impl((SemLockObject *)self); - - return return_value; + return _multiprocessing_SemLock__get_value_impl((SemLockObject *)self); } #endif /* defined(HAVE_MP_SEMAPHORE) */ @@ -440,11 +432,7 @@ _multiprocessing_SemLock__is_zero_impl(SemLockObject *self); static PyObject * _multiprocessing_SemLock__is_zero(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _multiprocessing_SemLock__is_zero_impl((SemLockObject *)self); - - return return_value; + return _multiprocessing_SemLock__is_zero_impl((SemLockObject *)self); } #endif /* defined(HAVE_MP_SEMAPHORE) */ @@ -466,11 +454,7 @@ _multiprocessing_SemLock__after_fork_impl(SemLockObject *self); static PyObject * _multiprocessing_SemLock__after_fork(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _multiprocessing_SemLock__after_fork_impl((SemLockObject *)self); - - return return_value; + return _multiprocessing_SemLock__after_fork_impl((SemLockObject *)self); } #endif /* defined(HAVE_MP_SEMAPHORE) */ @@ -592,4 +576,4 @@ _multiprocessing_SemLock___exit__(PyObject *self, PyObject *const *args, Py_ssiz #ifndef _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF #define _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF #endif /* !defined(_MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF) */ -/*[clinic end generated code: output=01e706da40883df7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e28d0fdbfefd1235 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/blob.c.h b/Modules/_sqlite/clinic/blob.c.h index 01855aca6f5f46..921e7cbd7ffcab 100644 --- a/Modules/_sqlite/clinic/blob.c.h +++ b/Modules/_sqlite/clinic/blob.c.h @@ -19,11 +19,7 @@ blob_close_impl(pysqlite_Blob *self); static PyObject * blob_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = blob_close_impl((pysqlite_Blob *)self); - - return return_value; + return blob_close_impl((pysqlite_Blob *)self); } PyDoc_STRVAR(blob_read__doc__, @@ -162,11 +158,7 @@ blob_tell_impl(pysqlite_Blob *self); static PyObject * blob_tell(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = blob_tell_impl((pysqlite_Blob *)self); - - return return_value; + return blob_tell_impl((pysqlite_Blob *)self); } PyDoc_STRVAR(blob_enter__doc__, @@ -184,11 +176,7 @@ blob_enter_impl(pysqlite_Blob *self); static PyObject * blob_enter(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = blob_enter_impl((pysqlite_Blob *)self); - - return return_value; + return blob_enter_impl((pysqlite_Blob *)self); } PyDoc_STRVAR(blob_exit__doc__, @@ -223,4 +211,4 @@ blob_exit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=b7553a77a3f36b31 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f03f4ba622b67ae0 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/connection.c.h b/Modules/_sqlite/clinic/connection.c.h index b3590054f2c2b7..bbdefe24a01370 100644 --- a/Modules/_sqlite/clinic/connection.c.h +++ b/Modules/_sqlite/clinic/connection.c.h @@ -374,11 +374,7 @@ pysqlite_connection_close_impl(pysqlite_Connection *self); static PyObject * pysqlite_connection_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pysqlite_connection_close_impl((pysqlite_Connection *)self); - - return return_value; + return pysqlite_connection_close_impl((pysqlite_Connection *)self); } PyDoc_STRVAR(pysqlite_connection_commit__doc__, @@ -398,11 +394,7 @@ pysqlite_connection_commit_impl(pysqlite_Connection *self); static PyObject * pysqlite_connection_commit(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pysqlite_connection_commit_impl((pysqlite_Connection *)self); - - return return_value; + return pysqlite_connection_commit_impl((pysqlite_Connection *)self); } PyDoc_STRVAR(pysqlite_connection_rollback__doc__, @@ -422,11 +414,7 @@ pysqlite_connection_rollback_impl(pysqlite_Connection *self); static PyObject * pysqlite_connection_rollback(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pysqlite_connection_rollback_impl((pysqlite_Connection *)self); - - return return_value; + return pysqlite_connection_rollback_impl((pysqlite_Connection *)self); } PyDoc_STRVAR(pysqlite_connection_create_function__doc__, @@ -1236,11 +1224,7 @@ pysqlite_connection_interrupt_impl(pysqlite_Connection *self); static PyObject * pysqlite_connection_interrupt(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pysqlite_connection_interrupt_impl((pysqlite_Connection *)self); - - return return_value; + return pysqlite_connection_interrupt_impl((pysqlite_Connection *)self); } PyDoc_STRVAR(pysqlite_connection_iterdump__doc__, @@ -1698,11 +1682,7 @@ pysqlite_connection_enter_impl(pysqlite_Connection *self); static PyObject * pysqlite_connection_enter(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pysqlite_connection_enter_impl((pysqlite_Connection *)self); - - return return_value; + return pysqlite_connection_enter_impl((pysqlite_Connection *)self); } PyDoc_STRVAR(pysqlite_connection_exit__doc__, @@ -1915,4 +1895,4 @@ getconfig(PyObject *self, PyObject *arg) #ifndef DESERIALIZE_METHODDEF #define DESERIALIZE_METHODDEF #endif /* !defined(DESERIALIZE_METHODDEF) */ -/*[clinic end generated code: output=c518b3e5ebe4b9b9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fc4857f09ad563b1 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/cursor.c.h b/Modules/_sqlite/clinic/cursor.c.h index 59ed8325fa8340..832ba2e43f02bb 100644 --- a/Modules/_sqlite/clinic/cursor.c.h +++ b/Modules/_sqlite/clinic/cursor.c.h @@ -165,11 +165,7 @@ pysqlite_cursor_fetchone_impl(pysqlite_Cursor *self); static PyObject * pysqlite_cursor_fetchone(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pysqlite_cursor_fetchone_impl((pysqlite_Cursor *)self); - - return return_value; + return pysqlite_cursor_fetchone_impl((pysqlite_Cursor *)self); } PyDoc_STRVAR(pysqlite_cursor_fetchmany__doc__, @@ -254,11 +250,7 @@ pysqlite_cursor_fetchall_impl(pysqlite_Cursor *self); static PyObject * pysqlite_cursor_fetchall(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pysqlite_cursor_fetchall_impl((pysqlite_Cursor *)self); - - return return_value; + return pysqlite_cursor_fetchall_impl((pysqlite_Cursor *)self); } PyDoc_STRVAR(pysqlite_cursor_setinputsizes__doc__, @@ -333,10 +325,6 @@ pysqlite_cursor_close_impl(pysqlite_Cursor *self); static PyObject * pysqlite_cursor_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pysqlite_cursor_close_impl((pysqlite_Cursor *)self); - - return return_value; + return pysqlite_cursor_close_impl((pysqlite_Cursor *)self); } -/*[clinic end generated code: output=ad3519acb068dcaf input=a9049054013a1b77]*/ +/*[clinic end generated code: output=02831aed7377f5f6 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/row.c.h b/Modules/_sqlite/clinic/row.c.h index c72f3552ddd7f9..068906744e445f 100644 --- a/Modules/_sqlite/clinic/row.c.h +++ b/Modules/_sqlite/clinic/row.c.h @@ -54,10 +54,6 @@ pysqlite_row_keys_impl(pysqlite_Row *self); static PyObject * pysqlite_row_keys(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pysqlite_row_keys_impl((pysqlite_Row *)self); - - return return_value; + return pysqlite_row_keys_impl((pysqlite_Row *)self); } -/*[clinic end generated code: output=6d348877c833b604 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6c1acbb48f386468 input=a9049054013a1b77]*/ diff --git a/Modules/_sre/clinic/sre.c.h b/Modules/_sre/clinic/sre.c.h index c0db1cb5b1a740..1f7e037351d1c6 100644 --- a/Modules/_sre/clinic/sre.c.h +++ b/Modules/_sre/clinic/sre.c.h @@ -974,11 +974,7 @@ _sre_SRE_Pattern___copy___impl(PatternObject *self); static PyObject * _sre_SRE_Pattern___copy__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _sre_SRE_Pattern___copy___impl((PatternObject *)self); - - return return_value; + return _sre_SRE_Pattern___copy___impl((PatternObject *)self); } PyDoc_STRVAR(_sre_SRE_Pattern___deepcopy____doc__, @@ -1477,11 +1473,7 @@ _sre_SRE_Match___copy___impl(MatchObject *self); static PyObject * _sre_SRE_Match___copy__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _sre_SRE_Match___copy___impl((MatchObject *)self); - - return return_value; + return _sre_SRE_Match___copy___impl((MatchObject *)self); } PyDoc_STRVAR(_sre_SRE_Match___deepcopy____doc__, @@ -1519,16 +1511,11 @@ _sre_SRE_Scanner_match_impl(ScannerObject *self, PyTypeObject *cls); static PyObject * _sre_SRE_Scanner_match(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "match() takes no arguments"); - goto exit; + return NULL; } - return_value = _sre_SRE_Scanner_match_impl((ScannerObject *)self, cls); - -exit: - return return_value; + return _sre_SRE_Scanner_match_impl((ScannerObject *)self, cls); } PyDoc_STRVAR(_sre_SRE_Scanner_search__doc__, @@ -1545,19 +1532,14 @@ _sre_SRE_Scanner_search_impl(ScannerObject *self, PyTypeObject *cls); static PyObject * _sre_SRE_Scanner_search(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "search() takes no arguments"); - goto exit; + return NULL; } - return_value = _sre_SRE_Scanner_search_impl((ScannerObject *)self, cls); - -exit: - return return_value; + return _sre_SRE_Scanner_search_impl((ScannerObject *)self, cls); } #ifndef _SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF #define _SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF #endif /* !defined(_SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF) */ -/*[clinic end generated code: output=e3189955b9a16cf3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=45baae8bdfafdc51 input=a9049054013a1b77]*/ diff --git a/Modules/_ssl/clinic/cert.c.h b/Modules/_ssl/clinic/cert.c.h index d4b7070847d864..3e0c5b405092db 100644 --- a/Modules/_ssl/clinic/cert.c.h +++ b/Modules/_ssl/clinic/cert.c.h @@ -85,10 +85,6 @@ _ssl_Certificate_get_info_impl(PySSLCertificate *self); static PyObject * _ssl_Certificate_get_info(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _ssl_Certificate_get_info_impl((PySSLCertificate *)self); - - return return_value; + return _ssl_Certificate_get_info_impl((PySSLCertificate *)self); } -/*[clinic end generated code: output=9de85ca49784b7a1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=51365b498b975ee0 input=a9049054013a1b77]*/ diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index 25a47e6f7ce7dc..d77bbd48066354 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -270,11 +270,7 @@ _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEn static PyObject * _multibytecodec_MultibyteIncrementalEncoder_getstate(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _multibytecodec_MultibyteIncrementalEncoder_getstate_impl((MultibyteIncrementalEncoderObject *)self); - - return return_value; + return _multibytecodec_MultibyteIncrementalEncoder_getstate_impl((MultibyteIncrementalEncoderObject *)self); } PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_setstate__doc__, @@ -320,11 +316,7 @@ _multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncod static PyObject * _multibytecodec_MultibyteIncrementalEncoder_reset(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _multibytecodec_MultibyteIncrementalEncoder_reset_impl((MultibyteIncrementalEncoderObject *)self); - - return return_value; + return _multibytecodec_MultibyteIncrementalEncoder_reset_impl((MultibyteIncrementalEncoderObject *)self); } PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_decode__doc__, @@ -415,11 +407,7 @@ _multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDe static PyObject * _multibytecodec_MultibyteIncrementalDecoder_getstate(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _multibytecodec_MultibyteIncrementalDecoder_getstate_impl((MultibyteIncrementalDecoderObject *)self); - - return return_value; + return _multibytecodec_MultibyteIncrementalDecoder_getstate_impl((MultibyteIncrementalDecoderObject *)self); } PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_setstate__doc__, @@ -465,11 +453,7 @@ _multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecod static PyObject * _multibytecodec_MultibyteIncrementalDecoder_reset(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _multibytecodec_MultibyteIncrementalDecoder_reset_impl((MultibyteIncrementalDecoderObject *)self); - - return return_value; + return _multibytecodec_MultibyteIncrementalDecoder_reset_impl((MultibyteIncrementalDecoderObject *)self); } PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__, @@ -582,11 +566,7 @@ _multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *se static PyObject * _multibytecodec_MultibyteStreamReader_reset(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _multibytecodec_MultibyteStreamReader_reset_impl((MultibyteStreamReaderObject *)self); - - return return_value; + return _multibytecodec_MultibyteStreamReader_reset_impl((MultibyteStreamReaderObject *)self); } PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_write__doc__, @@ -694,16 +674,11 @@ _multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *se static PyObject * _multibytecodec_MultibyteStreamWriter_reset(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "reset() takes no arguments"); - goto exit; + return NULL; } - return_value = _multibytecodec_MultibyteStreamWriter_reset_impl((MultibyteStreamWriterObject *)self, cls); - -exit: - return return_value; + return _multibytecodec_MultibyteStreamWriter_reset_impl((MultibyteStreamWriterObject *)self, cls); } PyDoc_STRVAR(_multibytecodec___create_codec__doc__, @@ -713,4 +688,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=54c020a95ab3de66 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6571941b8e45b013 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_asynciomodule.c.h b/Modules/clinic/_asynciomodule.c.h index 2f38445c93ca11..d529b09bd1529f 100644 --- a/Modules/clinic/_asynciomodule.c.h +++ b/Modules/clinic/_asynciomodule.c.h @@ -1474,11 +1474,7 @@ _asyncio_Task_get_context_impl(TaskObj *self); static PyObject * _asyncio_Task_get_context(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _asyncio_Task_get_context_impl((TaskObj *)self); - - return return_value; + return _asyncio_Task_get_context_impl((TaskObj *)self); } PyDoc_STRVAR(_asyncio_Task_get_name__doc__, @@ -2204,4 +2200,4 @@ _asyncio_future_discard_from_awaited_by(PyObject *module, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=f186505df0f9da89 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b1060b180d9dd54c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index bc9a33e4fca0fb..a599bd1a8be96a 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -65,11 +65,7 @@ _bz2_BZ2Compressor_flush_impl(BZ2Compressor *self); static PyObject * _bz2_BZ2Compressor_flush(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _bz2_BZ2Compressor_flush_impl((BZ2Compressor *)self); - - return return_value; + return _bz2_BZ2Compressor_flush_impl((BZ2Compressor *)self); } PyDoc_STRVAR(_bz2_BZ2Compressor__doc__, @@ -239,4 +235,4 @@ _bz2_BZ2Decompressor(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=1fde2ac12ffe85a3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0fc5a6292c5fd2c5 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_collectionsmodule.c.h b/Modules/clinic/_collectionsmodule.c.h index c543c4310c804c..c7dc639ce87ad8 100644 --- a/Modules/clinic/_collectionsmodule.c.h +++ b/Modules/clinic/_collectionsmodule.c.h @@ -449,11 +449,7 @@ deque___reduce___impl(dequeobject *deque); static PyObject * deque___reduce__(PyObject *deque, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = deque___reduce___impl((dequeobject *)deque); - - return return_value; + return deque___reduce___impl((dequeobject *)deque); } PyDoc_STRVAR(deque_init__doc__, @@ -564,11 +560,7 @@ deque___reversed___impl(dequeobject *deque); static PyObject * deque___reversed__(PyObject *deque, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = deque___reversed___impl((dequeobject *)deque); - - return return_value; + return deque___reversed___impl((dequeobject *)deque); } PyDoc_STRVAR(_collections__count_elements__doc__, @@ -638,4 +630,4 @@ tuplegetter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=509297265c703000 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1eb3634d5ef8b407 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_curses_panel.c.h b/Modules/clinic/_curses_panel.c.h index e4b4994eb6eb38..6f4966825ec4bf 100644 --- a/Modules/clinic/_curses_panel.c.h +++ b/Modules/clinic/_curses_panel.c.h @@ -22,16 +22,11 @@ _curses_panel_panel_bottom_impl(PyCursesPanelObject *self, PyTypeObject *cls); static PyObject * _curses_panel_panel_bottom(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "bottom() takes no arguments"); - goto exit; + return NULL; } - return_value = _curses_panel_panel_bottom_impl((PyCursesPanelObject *)self, cls); - -exit: - return return_value; + return _curses_panel_panel_bottom_impl((PyCursesPanelObject *)self, cls); } PyDoc_STRVAR(_curses_panel_panel_hide__doc__, @@ -51,16 +46,11 @@ _curses_panel_panel_hide_impl(PyCursesPanelObject *self, PyTypeObject *cls); static PyObject * _curses_panel_panel_hide(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "hide() takes no arguments"); - goto exit; + return NULL; } - return_value = _curses_panel_panel_hide_impl((PyCursesPanelObject *)self, cls); - -exit: - return return_value; + return _curses_panel_panel_hide_impl((PyCursesPanelObject *)self, cls); } PyDoc_STRVAR(_curses_panel_panel_show__doc__, @@ -78,16 +68,11 @@ _curses_panel_panel_show_impl(PyCursesPanelObject *self, PyTypeObject *cls); static PyObject * _curses_panel_panel_show(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "show() takes no arguments"); - goto exit; + return NULL; } - return_value = _curses_panel_panel_show_impl((PyCursesPanelObject *)self, cls); - -exit: - return return_value; + return _curses_panel_panel_show_impl((PyCursesPanelObject *)self, cls); } PyDoc_STRVAR(_curses_panel_panel_top__doc__, @@ -105,16 +90,11 @@ _curses_panel_panel_top_impl(PyCursesPanelObject *self, PyTypeObject *cls); static PyObject * _curses_panel_panel_top(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "top() takes no arguments"); - goto exit; + return NULL; } - return_value = _curses_panel_panel_top_impl((PyCursesPanelObject *)self, cls); - -exit: - return return_value; + return _curses_panel_panel_top_impl((PyCursesPanelObject *)self, cls); } PyDoc_STRVAR(_curses_panel_panel_above__doc__, @@ -132,11 +112,7 @@ _curses_panel_panel_above_impl(PyCursesPanelObject *self); static PyObject * _curses_panel_panel_above(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _curses_panel_panel_above_impl((PyCursesPanelObject *)self); - - return return_value; + return _curses_panel_panel_above_impl((PyCursesPanelObject *)self); } PyDoc_STRVAR(_curses_panel_panel_below__doc__, @@ -154,11 +130,7 @@ _curses_panel_panel_below_impl(PyCursesPanelObject *self); static PyObject * _curses_panel_panel_below(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _curses_panel_panel_below_impl((PyCursesPanelObject *)self); - - return return_value; + return _curses_panel_panel_below_impl((PyCursesPanelObject *)self); } PyDoc_STRVAR(_curses_panel_panel_hidden__doc__, @@ -176,11 +148,7 @@ _curses_panel_panel_hidden_impl(PyCursesPanelObject *self); static PyObject * _curses_panel_panel_hidden(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _curses_panel_panel_hidden_impl((PyCursesPanelObject *)self); - - return return_value; + return _curses_panel_panel_hidden_impl((PyCursesPanelObject *)self); } PyDoc_STRVAR(_curses_panel_panel_move__doc__, @@ -251,11 +219,7 @@ _curses_panel_panel_window_impl(PyCursesPanelObject *self); static PyObject * _curses_panel_panel_window(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _curses_panel_panel_window_impl((PyCursesPanelObject *)self); - - return return_value; + return _curses_panel_panel_window_impl((PyCursesPanelObject *)self); } PyDoc_STRVAR(_curses_panel_panel_replace__doc__, @@ -369,16 +333,11 @@ _curses_panel_panel_userptr_impl(PyCursesPanelObject *self, static PyObject * _curses_panel_panel_userptr(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "userptr() takes no arguments"); - goto exit; + return NULL; } - return_value = _curses_panel_panel_userptr_impl((PyCursesPanelObject *)self, cls); - -exit: - return return_value; + return _curses_panel_panel_userptr_impl((PyCursesPanelObject *)self, cls); } PyDoc_STRVAR(_curses_panel_bottom_panel__doc__, @@ -465,4 +424,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _curses_panel_update_panels_impl(module); } -/*[clinic end generated code: output=e8515683b1080c2f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=36853ecb4a979814 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index 228701b6e4e835..769d75c09010bd 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -1347,11 +1347,7 @@ _curses_window_noutrefresh_impl(PyCursesWindowObject *self); static PyObject * _curses_window_noutrefresh(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _curses_window_noutrefresh_impl((PyCursesWindowObject *)self); - - return return_value; + return _curses_window_noutrefresh_impl((PyCursesWindowObject *)self); } #endif /* !defined(py_is_pad) */ @@ -4396,4 +4392,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=841c5e5714faf9c5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ce2d19df9e20bfa3 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h index 076316d57e85de..5e503194408776 100644 --- a/Modules/clinic/_dbmmodule.c.h +++ b/Modules/clinic/_dbmmodule.c.h @@ -22,11 +22,7 @@ _dbm_dbm_close_impl(dbmobject *self); static PyObject * _dbm_dbm_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _dbm_dbm_close_impl((dbmobject *)self); - - return return_value; + return _dbm_dbm_close_impl((dbmobject *)self); } PyDoc_STRVAR(_dbm_dbm_keys__doc__, @@ -44,16 +40,11 @@ _dbm_dbm_keys_impl(dbmobject *self, PyTypeObject *cls); static PyObject * _dbm_dbm_keys(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "keys() takes no arguments"); - goto exit; + return NULL; } - return_value = _dbm_dbm_keys_impl((dbmobject *)self, cls); - -exit: - return return_value; + return _dbm_dbm_keys_impl((dbmobject *)self, cls); } PyDoc_STRVAR(_dbm_dbm_get__doc__, @@ -161,16 +152,11 @@ _dbm_dbm_clear_impl(dbmobject *self, PyTypeObject *cls); static PyObject * _dbm_dbm_clear(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "clear() takes no arguments"); - goto exit; + return NULL; } - return_value = _dbm_dbm_clear_impl((dbmobject *)self, cls); - -exit: - return return_value; + return _dbm_dbm_clear_impl((dbmobject *)self, cls); } PyDoc_STRVAR(dbmopen__doc__, @@ -235,4 +221,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=c6eba7e58b6f969a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3b456118f231b160 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 44a56cab783e65..e79f20d86204bb 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -71,11 +71,7 @@ _elementtree_Element_clear_impl(ElementObject *self); static PyObject * _elementtree_Element_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _elementtree_Element_clear_impl((ElementObject *)self); - - return return_value; + return _elementtree_Element_clear_impl((ElementObject *)self); } PyDoc_STRVAR(_elementtree_Element___copy____doc__, @@ -92,16 +88,11 @@ _elementtree_Element___copy___impl(ElementObject *self, PyTypeObject *cls); static PyObject * _elementtree_Element___copy__(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "__copy__() takes no arguments"); - goto exit; + return NULL; } - return_value = _elementtree_Element___copy___impl((ElementObject *)self, cls); - -exit: - return return_value; + return _elementtree_Element___copy___impl((ElementObject *)self, cls); } PyDoc_STRVAR(_elementtree_Element___deepcopy____doc__, @@ -173,11 +164,7 @@ _elementtree_Element___getstate___impl(ElementObject *self); static PyObject * _elementtree_Element___getstate__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _elementtree_Element___getstate___impl((ElementObject *)self); - - return return_value; + return _elementtree_Element___getstate___impl((ElementObject *)self); } PyDoc_STRVAR(_elementtree_Element___setstate____doc__, @@ -666,16 +653,11 @@ _elementtree_Element_itertext_impl(ElementObject *self, PyTypeObject *cls); static PyObject * _elementtree_Element_itertext(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "itertext() takes no arguments"); - goto exit; + return NULL; } - return_value = _elementtree_Element_itertext_impl((ElementObject *)self, cls); - -exit: - return return_value; + return _elementtree_Element_itertext_impl((ElementObject *)self, cls); } PyDoc_STRVAR(_elementtree_Element_insert__doc__, @@ -737,11 +719,7 @@ _elementtree_Element_items_impl(ElementObject *self); static PyObject * _elementtree_Element_items(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _elementtree_Element_items_impl((ElementObject *)self); - - return return_value; + return _elementtree_Element_items_impl((ElementObject *)self); } PyDoc_STRVAR(_elementtree_Element_keys__doc__, @@ -758,11 +736,7 @@ _elementtree_Element_keys_impl(ElementObject *self); static PyObject * _elementtree_Element_keys(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _elementtree_Element_keys_impl((ElementObject *)self); - - return return_value; + return _elementtree_Element_keys_impl((ElementObject *)self); } PyDoc_STRVAR(_elementtree_Element_makeelement__doc__, @@ -1114,11 +1088,7 @@ _elementtree_TreeBuilder_close_impl(TreeBuilderObject *self); static PyObject * _elementtree_TreeBuilder_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _elementtree_TreeBuilder_close_impl((TreeBuilderObject *)self); - - return return_value; + return _elementtree_TreeBuilder_close_impl((TreeBuilderObject *)self); } PyDoc_STRVAR(_elementtree_TreeBuilder_start__doc__, @@ -1248,11 +1218,7 @@ _elementtree_XMLParser_close_impl(XMLParserObject *self); static PyObject * _elementtree_XMLParser_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _elementtree_XMLParser_close_impl((XMLParserObject *)self); - - return return_value; + return _elementtree_XMLParser_close_impl((XMLParserObject *)self); } PyDoc_STRVAR(_elementtree_XMLParser_flush__doc__, @@ -1269,11 +1235,7 @@ _elementtree_XMLParser_flush_impl(XMLParserObject *self); static PyObject * _elementtree_XMLParser_flush(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _elementtree_XMLParser_flush_impl((XMLParserObject *)self); - - return return_value; + return _elementtree_XMLParser_flush_impl((XMLParserObject *)self); } PyDoc_STRVAR(_elementtree_XMLParser_feed__doc__, @@ -1353,4 +1315,4 @@ _elementtree_XMLParser__setevents(PyObject *self, PyObject *const *args, Py_ssiz exit: return return_value; } -/*[clinic end generated code: output=4a5f5d213fe87e16 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0eed58350c3c1832 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h index 1f901b8d632431..00950f18e53541 100644 --- a/Modules/clinic/_gdbmmodule.c.h +++ b/Modules/clinic/_gdbmmodule.c.h @@ -91,11 +91,7 @@ _gdbm_gdbm_close_impl(gdbmobject *self); static PyObject * _gdbm_gdbm_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _gdbm_gdbm_close_impl((gdbmobject *)self); - - return return_value; + return _gdbm_gdbm_close_impl((gdbmobject *)self); } PyDoc_STRVAR(_gdbm_gdbm_keys__doc__, @@ -113,16 +109,11 @@ _gdbm_gdbm_keys_impl(gdbmobject *self, PyTypeObject *cls); static PyObject * _gdbm_gdbm_keys(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "keys() takes no arguments"); - goto exit; + return NULL; } - return_value = _gdbm_gdbm_keys_impl((gdbmobject *)self, cls); - -exit: - return return_value; + return _gdbm_gdbm_keys_impl((gdbmobject *)self, cls); } PyDoc_STRVAR(_gdbm_gdbm_firstkey__doc__, @@ -144,16 +135,11 @@ _gdbm_gdbm_firstkey_impl(gdbmobject *self, PyTypeObject *cls); static PyObject * _gdbm_gdbm_firstkey(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "firstkey() takes no arguments"); - goto exit; + return NULL; } - return_value = _gdbm_gdbm_firstkey_impl((gdbmobject *)self, cls); - -exit: - return return_value; + return _gdbm_gdbm_firstkey_impl((gdbmobject *)self, cls); } PyDoc_STRVAR(_gdbm_gdbm_nextkey__doc__, @@ -228,16 +214,11 @@ _gdbm_gdbm_reorganize_impl(gdbmobject *self, PyTypeObject *cls); static PyObject * _gdbm_gdbm_reorganize(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "reorganize() takes no arguments"); - goto exit; + return NULL; } - return_value = _gdbm_gdbm_reorganize_impl((gdbmobject *)self, cls); - -exit: - return return_value; + return _gdbm_gdbm_reorganize_impl((gdbmobject *)self, cls); } PyDoc_STRVAR(_gdbm_gdbm_sync__doc__, @@ -258,16 +239,11 @@ _gdbm_gdbm_sync_impl(gdbmobject *self, PyTypeObject *cls); static PyObject * _gdbm_gdbm_sync(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "sync() takes no arguments"); - goto exit; + return NULL; } - return_value = _gdbm_gdbm_sync_impl((gdbmobject *)self, cls); - -exit: - return return_value; + return _gdbm_gdbm_sync_impl((gdbmobject *)self, cls); } PyDoc_STRVAR(_gdbm_gdbm_clear__doc__, @@ -285,16 +261,11 @@ _gdbm_gdbm_clear_impl(gdbmobject *self, PyTypeObject *cls); static PyObject * _gdbm_gdbm_clear(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "clear() takes no arguments"); - goto exit; + return NULL; } - return_value = _gdbm_gdbm_clear_impl((gdbmobject *)self, cls); - -exit: - return return_value; + return _gdbm_gdbm_clear_impl((gdbmobject *)self, cls); } PyDoc_STRVAR(dbmopen__doc__, @@ -372,4 +343,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=524bfb0fb71263fd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d974cb39e4ee5d67 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index 5afcfb58eefc7b..7bf6af1eeeba24 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -24,11 +24,7 @@ EVP_copy_impl(EVPobject *self); static PyObject * EVP_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = EVP_copy_impl((EVPobject *)self); - - return return_value; + return EVP_copy_impl((EVPobject *)self); } PyDoc_STRVAR(EVP_digest__doc__, @@ -46,11 +42,7 @@ EVP_digest_impl(EVPobject *self); static PyObject * EVP_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = EVP_digest_impl((EVPobject *)self); - - return return_value; + return EVP_digest_impl((EVPobject *)self); } PyDoc_STRVAR(EVP_hexdigest__doc__, @@ -68,11 +60,7 @@ EVP_hexdigest_impl(EVPobject *self); static PyObject * EVP_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = EVP_hexdigest_impl((EVPobject *)self); - - return return_value; + return EVP_hexdigest_impl((EVPobject *)self); } PyDoc_STRVAR(EVP_update__doc__, @@ -1661,11 +1649,7 @@ _hashlib_HMAC_copy_impl(HMACobject *self); static PyObject * _hashlib_HMAC_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _hashlib_HMAC_copy_impl((HMACobject *)self); - - return return_value; + return _hashlib_HMAC_copy_impl((HMACobject *)self); } PyDoc_STRVAR(_hashlib_HMAC_update__doc__, @@ -1739,11 +1723,7 @@ _hashlib_HMAC_digest_impl(HMACobject *self); static PyObject * _hashlib_HMAC_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _hashlib_HMAC_digest_impl((HMACobject *)self); - - return return_value; + return _hashlib_HMAC_digest_impl((HMACobject *)self); } PyDoc_STRVAR(_hashlib_HMAC_hexdigest__doc__, @@ -1764,11 +1744,7 @@ _hashlib_HMAC_hexdigest_impl(HMACobject *self); static PyObject * _hashlib_HMAC_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _hashlib_HMAC_hexdigest_impl((HMACobject *)self); - - return return_value; + return _hashlib_HMAC_hexdigest_impl((HMACobject *)self); } PyDoc_STRVAR(_hashlib_get_fips_mode__doc__, @@ -1881,4 +1857,4 @@ _hashlib_compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t narg #ifndef _HASHLIB_SCRYPT_METHODDEF #define _HASHLIB_SCRYPT_METHODDEF #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */ -/*[clinic end generated code: output=140f479c4eaea484 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e9624853a73bb65a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lsprof.c.h b/Modules/clinic/_lsprof.c.h index e322b7cc52f8a0..6a75a8f9833d1e 100644 --- a/Modules/clinic/_lsprof.c.h +++ b/Modules/clinic/_lsprof.c.h @@ -45,16 +45,11 @@ _lsprof_Profiler_getstats_impl(ProfilerObject *self, PyTypeObject *cls); static PyObject * _lsprof_Profiler_getstats(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "getstats() takes no arguments"); - goto exit; + return NULL; } - return_value = _lsprof_Profiler_getstats_impl((ProfilerObject *)self, cls); - -exit: - return return_value; + return _lsprof_Profiler_getstats_impl((ProfilerObject *)self, cls); } PyDoc_STRVAR(_lsprof_Profiler__pystart_callback__doc__, @@ -290,11 +285,7 @@ _lsprof_Profiler_disable_impl(ProfilerObject *self); static PyObject * _lsprof_Profiler_disable(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _lsprof_Profiler_disable_impl((ProfilerObject *)self); - - return return_value; + return _lsprof_Profiler_disable_impl((ProfilerObject *)self); } PyDoc_STRVAR(_lsprof_Profiler_clear__doc__, @@ -312,11 +303,7 @@ _lsprof_Profiler_clear_impl(ProfilerObject *self); static PyObject * _lsprof_Profiler_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _lsprof_Profiler_clear_impl((ProfilerObject *)self); - - return return_value; + return _lsprof_Profiler_clear_impl((ProfilerObject *)self); } PyDoc_STRVAR(profiler_init__doc__, @@ -420,4 +407,4 @@ profiler_init(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=5326524fe31145ce input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d983dbf23fd8ac3b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h index 9f41df1530b1cd..c7c81d8d1f1b9d 100644 --- a/Modules/clinic/_lzmamodule.c.h +++ b/Modules/clinic/_lzmamodule.c.h @@ -65,11 +65,7 @@ _lzma_LZMACompressor_flush_impl(Compressor *self); static PyObject * _lzma_LZMACompressor_flush(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _lzma_LZMACompressor_flush_impl((Compressor *)self); - - return return_value; + return _lzma_LZMACompressor_flush_impl((Compressor *)self); } PyDoc_STRVAR(_lzma_LZMADecompressor_decompress__doc__, @@ -333,4 +329,4 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz return return_value; } -/*[clinic end generated code: output=b60d44e0f424f625 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=19ed9b1182f5ddf9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h index d19b0af9259c47..91d355c5afb353 100644 --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -28,11 +28,7 @@ _pickle_Pickler_clear_memo_impl(PicklerObject *self); static PyObject * _pickle_Pickler_clear_memo(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _pickle_Pickler_clear_memo_impl((PicklerObject *)self); - - return return_value; + return _pickle_Pickler_clear_memo_impl((PicklerObject *)self); } PyDoc_STRVAR(_pickle_Pickler_dump__doc__, @@ -233,11 +229,7 @@ _pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self); static PyObject * _pickle_PicklerMemoProxy_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _pickle_PicklerMemoProxy_clear_impl((PicklerMemoProxyObject *)self); - - return return_value; + return _pickle_PicklerMemoProxy_clear_impl((PicklerMemoProxyObject *)self); } PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__, @@ -255,11 +247,7 @@ _pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self); static PyObject * _pickle_PicklerMemoProxy_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _pickle_PicklerMemoProxy_copy_impl((PicklerMemoProxyObject *)self); - - return return_value; + return _pickle_PicklerMemoProxy_copy_impl((PicklerMemoProxyObject *)self); } PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__, @@ -277,11 +265,7 @@ _pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self); static PyObject * _pickle_PicklerMemoProxy___reduce__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _pickle_PicklerMemoProxy___reduce___impl((PicklerMemoProxyObject *)self); - - return return_value; + return _pickle_PicklerMemoProxy___reduce___impl((PicklerMemoProxyObject *)self); } PyDoc_STRVAR(_pickle_Unpickler_persistent_load__doc__, @@ -347,16 +331,11 @@ _pickle_Unpickler_load_impl(UnpicklerObject *self, PyTypeObject *cls); static PyObject * _pickle_Unpickler_load(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "load() takes no arguments"); - goto exit; + return NULL; } - return_value = _pickle_Unpickler_load_impl((UnpicklerObject *)self, cls); - -exit: - return return_value; + return _pickle_Unpickler_load_impl((UnpicklerObject *)self, cls); } PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__, @@ -589,11 +568,7 @@ _pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self); static PyObject * _pickle_UnpicklerMemoProxy_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _pickle_UnpicklerMemoProxy_clear_impl((UnpicklerMemoProxyObject *)self); - - return return_value; + return _pickle_UnpicklerMemoProxy_clear_impl((UnpicklerMemoProxyObject *)self); } PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__, @@ -611,11 +586,7 @@ _pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self); static PyObject * _pickle_UnpicklerMemoProxy_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _pickle_UnpicklerMemoProxy_copy_impl((UnpicklerMemoProxyObject *)self); - - return return_value; + return _pickle_UnpicklerMemoProxy_copy_impl((UnpicklerMemoProxyObject *)self); } PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__, @@ -633,11 +604,7 @@ _pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self); static PyObject * _pickle_UnpicklerMemoProxy___reduce__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _pickle_UnpicklerMemoProxy___reduce___impl((UnpicklerMemoProxyObject *)self); - - return return_value; + return _pickle_UnpicklerMemoProxy___reduce___impl((UnpicklerMemoProxyObject *)self); } PyDoc_STRVAR(_pickle_dump__doc__, @@ -1119,4 +1086,4 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=f37ff045f4feec40 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d71dc73af298ebe8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index 93bda4e0259685..9656f09c471931 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -255,11 +255,7 @@ _ssl__SSLSocket_compression_impl(PySSLSocket *self); static PyObject * _ssl__SSLSocket_compression(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _ssl__SSLSocket_compression_impl((PySSLSocket *)self); - - return return_value; + return _ssl__SSLSocket_compression_impl((PySSLSocket *)self); } PyDoc_STRVAR(_ssl__SSLSocket_context__doc__, @@ -2882,4 +2878,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=c0c80336beff60df input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c402c53dc30a14fa input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testmultiphase.c.h b/Modules/clinic/_testmultiphase.c.h index 63b6ab48a9b066..01c29c0753ae13 100644 --- a/Modules/clinic/_testmultiphase.c.h +++ b/Modules/clinic/_testmultiphase.c.h @@ -27,16 +27,11 @@ _testmultiphase_StateAccessType_get_defining_module_impl(StateAccessTypeObject * static PyObject * _testmultiphase_StateAccessType_get_defining_module(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "get_defining_module() takes no arguments"); - goto exit; + return NULL; } - return_value = _testmultiphase_StateAccessType_get_defining_module_impl((StateAccessTypeObject *)self, cls); - -exit: - return return_value; + return _testmultiphase_StateAccessType_get_defining_module_impl((StateAccessTypeObject *)self, cls); } PyDoc_STRVAR(_testmultiphase_StateAccessType_getmodulebydef_bad_def__doc__, @@ -55,16 +50,11 @@ _testmultiphase_StateAccessType_getmodulebydef_bad_def_impl(StateAccessTypeObjec static PyObject * _testmultiphase_StateAccessType_getmodulebydef_bad_def(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "getmodulebydef_bad_def() takes no arguments"); - goto exit; + return NULL; } - return_value = _testmultiphase_StateAccessType_getmodulebydef_bad_def_impl((StateAccessTypeObject *)self, cls); - -exit: - return return_value; + return _testmultiphase_StateAccessType_getmodulebydef_bad_def_impl((StateAccessTypeObject *)self, cls); } PyDoc_STRVAR(_testmultiphase_StateAccessType_increment_count_clinic__doc__, @@ -167,15 +157,10 @@ _testmultiphase_StateAccessType_get_count_impl(StateAccessTypeObject *self, static PyObject * _testmultiphase_StateAccessType_get_count(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "get_count() takes no arguments"); - goto exit; + return NULL; } - return_value = _testmultiphase_StateAccessType_get_count_impl((StateAccessTypeObject *)self, cls); - -exit: - return return_value; + return _testmultiphase_StateAccessType_get_count_impl((StateAccessTypeObject *)self, cls); } -/*[clinic end generated code: output=fc80df68095b414a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ea0ca98e467e53c2 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h index 1a66221c327371..352c2b9e3d410c 100644 --- a/Modules/clinic/_tkinter.c.h +++ b/Modules/clinic/_tkinter.c.h @@ -532,11 +532,7 @@ _tkinter_tktimertoken_deletetimerhandler_impl(TkttObject *self); static PyObject * _tkinter_tktimertoken_deletetimerhandler(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _tkinter_tktimertoken_deletetimerhandler_impl((TkttObject *)self); - - return return_value; + return _tkinter_tktimertoken_deletetimerhandler_impl((TkttObject *)self); } PyDoc_STRVAR(_tkinter_tkapp_createtimerhandler__doc__, @@ -654,11 +650,7 @@ _tkinter_tkapp_quit_impl(TkappObject *self); static PyObject * _tkinter_tkapp_quit(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _tkinter_tkapp_quit_impl((TkappObject *)self); - - return return_value; + return _tkinter_tkapp_quit_impl((TkappObject *)self); } PyDoc_STRVAR(_tkinter_tkapp_interpaddr__doc__, @@ -675,11 +667,7 @@ _tkinter_tkapp_interpaddr_impl(TkappObject *self); static PyObject * _tkinter_tkapp_interpaddr(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _tkinter_tkapp_interpaddr_impl((TkappObject *)self); - - return return_value; + return _tkinter_tkapp_interpaddr_impl((TkappObject *)self); } PyDoc_STRVAR(_tkinter_tkapp_loadtk__doc__, @@ -696,11 +684,7 @@ _tkinter_tkapp_loadtk_impl(TkappObject *self); static PyObject * _tkinter_tkapp_loadtk(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _tkinter_tkapp_loadtk_impl((TkappObject *)self); - - return return_value; + return _tkinter_tkapp_loadtk_impl((TkappObject *)self); } PyDoc_STRVAR(_tkinter_tkapp_settrace__doc__, @@ -740,11 +724,7 @@ _tkinter_tkapp_gettrace_impl(TkappObject *self); static PyObject * _tkinter_tkapp_gettrace(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _tkinter_tkapp_gettrace_impl((TkappObject *)self); - - return return_value; + return _tkinter_tkapp_gettrace_impl((TkappObject *)self); } PyDoc_STRVAR(_tkinter_tkapp_willdispatch__doc__, @@ -761,11 +741,7 @@ _tkinter_tkapp_willdispatch_impl(TkappObject *self); static PyObject * _tkinter_tkapp_willdispatch(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _tkinter_tkapp_willdispatch_impl((TkappObject *)self); - - return return_value; + return _tkinter_tkapp_willdispatch_impl((TkappObject *)self); } PyDoc_STRVAR(_tkinter__flatten__doc__, @@ -990,4 +966,4 @@ _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ -/*[clinic end generated code: output=4a4b9d107654402e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=052c067aa69237be input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h index baa97db6a2680f..6a2f8d45cd4e0c 100644 --- a/Modules/clinic/_winapi.c.h +++ b/Modules/clinic/_winapi.c.h @@ -50,11 +50,7 @@ _winapi_Overlapped_getbuffer_impl(OverlappedObject *self); static PyObject * _winapi_Overlapped_getbuffer(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _winapi_Overlapped_getbuffer_impl((OverlappedObject *)self); - - return return_value; + return _winapi_Overlapped_getbuffer_impl((OverlappedObject *)self); } PyDoc_STRVAR(_winapi_Overlapped_cancel__doc__, @@ -71,11 +67,7 @@ _winapi_Overlapped_cancel_impl(OverlappedObject *self); static PyObject * _winapi_Overlapped_cancel(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _winapi_Overlapped_cancel_impl((OverlappedObject *)self); - - return return_value; + return _winapi_Overlapped_cancel_impl((OverlappedObject *)self); } PyDoc_STRVAR(_winapi_CloseHandle__doc__, @@ -2135,4 +2127,4 @@ _winapi_CopyFile2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO return return_value; } -/*[clinic end generated code: output=fa34c08199a78ab2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=06b56212b2186250 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h index 7d178a02349732..97e5ca771f3a90 100644 --- a/Modules/clinic/arraymodule.c.h +++ b/Modules/clinic/arraymodule.c.h @@ -23,11 +23,7 @@ array_array_clear_impl(arrayobject *self); static PyObject * array_array_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = array_array_clear_impl((arrayobject *)self); - - return return_value; + return array_array_clear_impl((arrayobject *)self); } PyDoc_STRVAR(array_array___copy____doc__, @@ -45,11 +41,7 @@ array_array___copy___impl(arrayobject *self); static PyObject * array_array___copy__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = array_array___copy___impl((arrayobject *)self); - - return return_value; + return array_array___copy___impl((arrayobject *)self); } PyDoc_STRVAR(array_array___deepcopy____doc__, @@ -312,11 +304,7 @@ array_array_buffer_info_impl(arrayobject *self); static PyObject * array_array_buffer_info(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = array_array_buffer_info_impl((arrayobject *)self); - - return return_value; + return array_array_buffer_info_impl((arrayobject *)self); } PyDoc_STRVAR(array_array_append__doc__, @@ -359,11 +347,7 @@ array_array_byteswap_impl(arrayobject *self); static PyObject * array_array_byteswap(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = array_array_byteswap_impl((arrayobject *)self); - - return return_value; + return array_array_byteswap_impl((arrayobject *)self); } PyDoc_STRVAR(array_array_reverse__doc__, @@ -381,11 +365,7 @@ array_array_reverse_impl(arrayobject *self); static PyObject * array_array_reverse(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = array_array_reverse_impl((arrayobject *)self); - - return return_value; + return array_array_reverse_impl((arrayobject *)self); } PyDoc_STRVAR(array_array_fromfile__doc__, @@ -527,11 +507,7 @@ array_array_tolist_impl(arrayobject *self); static PyObject * array_array_tolist(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = array_array_tolist_impl((arrayobject *)self); - - return return_value; + return array_array_tolist_impl((arrayobject *)self); } PyDoc_STRVAR(array_array_frombytes__doc__, @@ -581,11 +557,7 @@ array_array_tobytes_impl(arrayobject *self); static PyObject * array_array_tobytes(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = array_array_tobytes_impl((arrayobject *)self); - - return return_value; + return array_array_tobytes_impl((arrayobject *)self); } PyDoc_STRVAR(array_array_fromunicode__doc__, @@ -640,11 +612,7 @@ array_array_tounicode_impl(arrayobject *self); static PyObject * array_array_tounicode(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = array_array_tounicode_impl((arrayobject *)self); - - return return_value; + return array_array_tounicode_impl((arrayobject *)self); } PyDoc_STRVAR(array_array___sizeof____doc__, @@ -662,11 +630,7 @@ array_array___sizeof___impl(arrayobject *self); static PyObject * array_array___sizeof__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = array_array___sizeof___impl((arrayobject *)self); - - return return_value; + return array_array___sizeof___impl((arrayobject *)self); } PyDoc_STRVAR(array__array_reconstructor__doc__, @@ -781,16 +745,11 @@ array_arrayiterator___reduce___impl(arrayiterobject *self, PyTypeObject *cls); static PyObject * array_arrayiterator___reduce__(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "__reduce__() takes no arguments"); - goto exit; + return NULL; } - return_value = array_arrayiterator___reduce___impl((arrayiterobject *)self, cls); - -exit: - return return_value; + return array_arrayiterator___reduce___impl((arrayiterobject *)self, cls); } PyDoc_STRVAR(array_arrayiterator___setstate____doc__, @@ -814,4 +773,4 @@ array_arrayiterator___setstate__(PyObject *self, PyObject *state) return return_value; } -/*[clinic end generated code: output=f9cf47814e69be1e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dd49451ac1cc3f39 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/blake2module.c.h b/Modules/clinic/blake2module.c.h index 42edd25186bf38..9450334bd676ef 100644 --- a/Modules/clinic/blake2module.c.h +++ b/Modules/clinic/blake2module.c.h @@ -414,11 +414,7 @@ _blake2_blake2b_copy_impl(Blake2Object *self); static PyObject * _blake2_blake2b_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _blake2_blake2b_copy_impl((Blake2Object *)self); - - return return_value; + return _blake2_blake2b_copy_impl((Blake2Object *)self); } PyDoc_STRVAR(_blake2_blake2b_update__doc__, @@ -458,11 +454,7 @@ _blake2_blake2b_digest_impl(Blake2Object *self); static PyObject * _blake2_blake2b_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _blake2_blake2b_digest_impl((Blake2Object *)self); - - return return_value; + return _blake2_blake2b_digest_impl((Blake2Object *)self); } PyDoc_STRVAR(_blake2_blake2b_hexdigest__doc__, @@ -480,10 +472,6 @@ _blake2_blake2b_hexdigest_impl(Blake2Object *self); static PyObject * _blake2_blake2b_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _blake2_blake2b_hexdigest_impl((Blake2Object *)self); - - return return_value; + return _blake2_blake2b_hexdigest_impl((Blake2Object *)self); } -/*[clinic end generated code: output=436fd660c7dce811 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b286a0d1be8729b0 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index 21d5ac001ac183..fc42bfb61f59e1 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -23,16 +23,11 @@ MD5Type_copy_impl(MD5object *self, PyTypeObject *cls); static PyObject * MD5Type_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - goto exit; + return NULL; } - return_value = MD5Type_copy_impl((MD5object *)self, cls); - -exit: - return return_value; + return MD5Type_copy_impl((MD5object *)self, cls); } PyDoc_STRVAR(MD5Type_digest__doc__, @@ -50,11 +45,7 @@ MD5Type_digest_impl(MD5object *self); static PyObject * MD5Type_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = MD5Type_digest_impl((MD5object *)self); - - return return_value; + return MD5Type_digest_impl((MD5object *)self); } PyDoc_STRVAR(MD5Type_hexdigest__doc__, @@ -72,11 +63,7 @@ MD5Type_hexdigest_impl(MD5object *self); static PyObject * MD5Type_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = MD5Type_hexdigest_impl((MD5object *)self); - - return return_value; + return MD5Type_hexdigest_impl((MD5object *)self); } PyDoc_STRVAR(MD5Type_update__doc__, @@ -175,4 +162,4 @@ _md5_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw exit: return return_value; } -/*[clinic end generated code: output=bbca8d26f2a4258d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=10db0ff2ecf97159 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/overlapped.c.h b/Modules/clinic/overlapped.c.h index 685a0a3e4ee422..7e5715660022c1 100644 --- a/Modules/clinic/overlapped.c.h +++ b/Modules/clinic/overlapped.c.h @@ -518,11 +518,7 @@ _overlapped_Overlapped_cancel_impl(OverlappedObject *self); static PyObject * _overlapped_Overlapped_cancel(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _overlapped_Overlapped_cancel_impl((OverlappedObject *)self); - - return return_value; + return _overlapped_Overlapped_cancel_impl((OverlappedObject *)self); } PyDoc_STRVAR(_overlapped_Overlapped_getresult__doc__, @@ -1244,4 +1240,4 @@ _overlapped_Overlapped_WSARecvFromInto(PyObject *self, PyObject *const *args, Py return return_value; } -/*[clinic end generated code: output=94e4cf1b39345ef4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d009cc9e53d9732a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index c38c6bf3456ad1..abeb9c3e3e12b1 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -11985,11 +11985,7 @@ os_DirEntry_inode_impl(DirEntry *self); static PyObject * os_DirEntry_inode(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = os_DirEntry_inode_impl((DirEntry *)self); - - return return_value; + return os_DirEntry_inode_impl((DirEntry *)self); } PyDoc_STRVAR(os_DirEntry___fspath____doc__, @@ -12007,11 +12003,7 @@ os_DirEntry___fspath___impl(DirEntry *self); static PyObject * os_DirEntry___fspath__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = os_DirEntry___fspath___impl((DirEntry *)self); - - return return_value; + return os_DirEntry___fspath___impl((DirEntry *)self); } PyDoc_STRVAR(os_scandir__doc__, @@ -13204,4 +13196,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=cb777904adc99e47 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8318c26fc2cd236c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h index 284c5252c68062..9eba59731c3fba 100644 --- a/Modules/clinic/pyexpat.c.h +++ b/Modules/clinic/pyexpat.c.h @@ -52,11 +52,7 @@ pyexpat_xmlparser_GetReparseDeferralEnabled_impl(xmlparseobject *self); static PyObject * pyexpat_xmlparser_GetReparseDeferralEnabled(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pyexpat_xmlparser_GetReparseDeferralEnabled_impl((xmlparseobject *)self); - - return return_value; + return pyexpat_xmlparser_GetReparseDeferralEnabled_impl((xmlparseobject *)self); } PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__, @@ -212,11 +208,7 @@ pyexpat_xmlparser_GetBase_impl(xmlparseobject *self); static PyObject * pyexpat_xmlparser_GetBase(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pyexpat_xmlparser_GetBase_impl((xmlparseobject *)self); - - return return_value; + return pyexpat_xmlparser_GetBase_impl((xmlparseobject *)self); } PyDoc_STRVAR(pyexpat_xmlparser_GetInputContext__doc__, @@ -237,11 +229,7 @@ pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self); static PyObject * pyexpat_xmlparser_GetInputContext(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = pyexpat_xmlparser_GetInputContext_impl((xmlparseobject *)self); - - return return_value; + return pyexpat_xmlparser_GetInputContext_impl((xmlparseobject *)self); } PyDoc_STRVAR(pyexpat_xmlparser_ExternalEntityParserCreate__doc__, @@ -562,4 +550,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg) #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=5ce407e79b4f0108 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7ee30ae5b666d0a8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/selectmodule.c.h b/Modules/clinic/selectmodule.c.h index 034fd9b6a9c905..d8bdd6f95f3d29 100644 --- a/Modules/clinic/selectmodule.c.h +++ b/Modules/clinic/selectmodule.c.h @@ -673,11 +673,7 @@ select_epoll_fileno_impl(pyEpoll_Object *self); static PyObject * select_epoll_fileno(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = select_epoll_fileno_impl((pyEpoll_Object *)self); - - return return_value; + return select_epoll_fileno_impl((pyEpoll_Object *)self); } #endif /* defined(HAVE_EPOLL) */ @@ -1037,11 +1033,7 @@ select_epoll___enter___impl(pyEpoll_Object *self); static PyObject * select_epoll___enter__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = select_epoll___enter___impl((pyEpoll_Object *)self); - - return return_value; + return select_epoll___enter___impl((pyEpoll_Object *)self); } #endif /* defined(HAVE_EPOLL) */ @@ -1184,11 +1176,7 @@ select_kqueue_fileno_impl(kqueue_queue_Object *self); static PyObject * select_kqueue_fileno(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = select_kqueue_fileno_impl((kqueue_queue_Object *)self); - - return return_value; + return select_kqueue_fileno_impl((kqueue_queue_Object *)self); } #endif /* defined(HAVE_KQUEUE) */ @@ -1377,4 +1365,4 @@ select_kqueue_control(PyObject *self, PyObject *const *args, Py_ssize_t nargs) #ifndef SELECT_KQUEUE_CONTROL_METHODDEF #define SELECT_KQUEUE_CONTROL_METHODDEF #endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */ -/*[clinic end generated code: output=c4c4122e737a5f7d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c18fd93efc5f4dce input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h index 0be2bb9d56d321..792059d9b89bb2 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -23,16 +23,11 @@ SHA1Type_copy_impl(SHA1object *self, PyTypeObject *cls); static PyObject * SHA1Type_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - goto exit; + return NULL; } - return_value = SHA1Type_copy_impl((SHA1object *)self, cls); - -exit: - return return_value; + return SHA1Type_copy_impl((SHA1object *)self, cls); } PyDoc_STRVAR(SHA1Type_digest__doc__, @@ -50,11 +45,7 @@ SHA1Type_digest_impl(SHA1object *self); static PyObject * SHA1Type_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = SHA1Type_digest_impl((SHA1object *)self); - - return return_value; + return SHA1Type_digest_impl((SHA1object *)self); } PyDoc_STRVAR(SHA1Type_hexdigest__doc__, @@ -72,11 +63,7 @@ SHA1Type_hexdigest_impl(SHA1object *self); static PyObject * SHA1Type_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = SHA1Type_hexdigest_impl((SHA1object *)self); - - return return_value; + return SHA1Type_hexdigest_impl((SHA1object *)self); } PyDoc_STRVAR(SHA1Type_update__doc__, @@ -175,4 +162,4 @@ _sha1_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * exit: return return_value; } -/*[clinic end generated code: output=d42333a7ee032349 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3cfa7b6a9f99b5b2 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha2module.c.h b/Modules/clinic/sha2module.c.h index 9e0a71b99ee2ab..5e4b97b8ed3c1d 100644 --- a/Modules/clinic/sha2module.c.h +++ b/Modules/clinic/sha2module.c.h @@ -23,16 +23,11 @@ SHA256Type_copy_impl(SHA256object *self, PyTypeObject *cls); static PyObject * SHA256Type_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - goto exit; + return NULL; } - return_value = SHA256Type_copy_impl((SHA256object *)self, cls); - -exit: - return return_value; + return SHA256Type_copy_impl((SHA256object *)self, cls); } PyDoc_STRVAR(SHA512Type_copy__doc__, @@ -50,16 +45,11 @@ SHA512Type_copy_impl(SHA512object *self, PyTypeObject *cls); static PyObject * SHA512Type_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - goto exit; + return NULL; } - return_value = SHA512Type_copy_impl((SHA512object *)self, cls); - -exit: - return return_value; + return SHA512Type_copy_impl((SHA512object *)self, cls); } PyDoc_STRVAR(SHA256Type_digest__doc__, @@ -77,11 +67,7 @@ SHA256Type_digest_impl(SHA256object *self); static PyObject * SHA256Type_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = SHA256Type_digest_impl((SHA256object *)self); - - return return_value; + return SHA256Type_digest_impl((SHA256object *)self); } PyDoc_STRVAR(SHA512Type_digest__doc__, @@ -99,11 +85,7 @@ SHA512Type_digest_impl(SHA512object *self); static PyObject * SHA512Type_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = SHA512Type_digest_impl((SHA512object *)self); - - return return_value; + return SHA512Type_digest_impl((SHA512object *)self); } PyDoc_STRVAR(SHA256Type_hexdigest__doc__, @@ -121,11 +103,7 @@ SHA256Type_hexdigest_impl(SHA256object *self); static PyObject * SHA256Type_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = SHA256Type_hexdigest_impl((SHA256object *)self); - - return return_value; + return SHA256Type_hexdigest_impl((SHA256object *)self); } PyDoc_STRVAR(SHA512Type_hexdigest__doc__, @@ -143,11 +121,7 @@ SHA512Type_hexdigest_impl(SHA512object *self); static PyObject * SHA512Type_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = SHA512Type_hexdigest_impl((SHA512object *)self); - - return return_value; + return SHA512Type_hexdigest_impl((SHA512object *)self); } PyDoc_STRVAR(SHA256Type_update__doc__, @@ -493,4 +467,4 @@ _sha2_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject exit: return return_value; } -/*[clinic end generated code: output=b8cb790573fddd96 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0c2eed5c77ec6987 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha3module.c.h b/Modules/clinic/sha3module.c.h index 815bde6cda73e8..98d8f10a96ee48 100644 --- a/Modules/clinic/sha3module.c.h +++ b/Modules/clinic/sha3module.c.h @@ -94,11 +94,7 @@ _sha3_sha3_224_copy_impl(SHA3object *self); static PyObject * _sha3_sha3_224_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _sha3_sha3_224_copy_impl((SHA3object *)self); - - return return_value; + return _sha3_sha3_224_copy_impl((SHA3object *)self); } PyDoc_STRVAR(_sha3_sha3_224_digest__doc__, @@ -116,11 +112,7 @@ _sha3_sha3_224_digest_impl(SHA3object *self); static PyObject * _sha3_sha3_224_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _sha3_sha3_224_digest_impl((SHA3object *)self); - - return return_value; + return _sha3_sha3_224_digest_impl((SHA3object *)self); } PyDoc_STRVAR(_sha3_sha3_224_hexdigest__doc__, @@ -138,11 +130,7 @@ _sha3_sha3_224_hexdigest_impl(SHA3object *self); static PyObject * _sha3_sha3_224_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _sha3_sha3_224_hexdigest_impl((SHA3object *)self); - - return return_value; + return _sha3_sha3_224_hexdigest_impl((SHA3object *)self); } PyDoc_STRVAR(_sha3_sha3_224_update__doc__, @@ -220,4 +208,4 @@ _sha3_shake_128_hexdigest(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=2e42278f2fd830ff input=a9049054013a1b77]*/ +/*[clinic end generated code: output=437023d9eac08551 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/socketmodule.c.h b/Modules/clinic/socketmodule.c.h index c1601e503a7a9b..dc62c4290d3e3b 100644 --- a/Modules/clinic/socketmodule.c.h +++ b/Modules/clinic/socketmodule.c.h @@ -25,11 +25,7 @@ _socket_socket_close_impl(PySocketSockObject *s); static PyObject * _socket_socket_close(PyObject *s, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _socket_socket_close_impl((PySocketSockObject *)s); - - return return_value; + return _socket_socket_close_impl((PySocketSockObject *)s); } static int @@ -284,4 +280,4 @@ _socket_socket_if_nametoindex(PyObject *self, PyObject *arg) #ifndef _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF #define _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF #endif /* !defined(_SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF) */ -/*[clinic end generated code: output=b6072fee513b1e0d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d39efc30d811e74b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h index 8f54a2abb4f9e5..91a3ac76bcf0cc 100644 --- a/Modules/clinic/zlibmodule.c.h +++ b/Modules/clinic/zlibmodule.c.h @@ -644,16 +644,11 @@ zlib_Compress_copy_impl(compobject *self, PyTypeObject *cls); static PyObject * zlib_Compress_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - goto exit; + return NULL; } - return_value = zlib_Compress_copy_impl((compobject *)self, cls); - -exit: - return return_value; + return zlib_Compress_copy_impl((compobject *)self, cls); } #endif /* defined(HAVE_ZLIB_COPY) */ @@ -674,16 +669,11 @@ zlib_Compress___copy___impl(compobject *self, PyTypeObject *cls); static PyObject * zlib_Compress___copy__(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "__copy__() takes no arguments"); - goto exit; + return NULL; } - return_value = zlib_Compress___copy___impl((compobject *)self, cls); - -exit: - return return_value; + return zlib_Compress___copy___impl((compobject *)self, cls); } #endif /* defined(HAVE_ZLIB_COPY) */ @@ -753,16 +743,11 @@ zlib_Decompress_copy_impl(compobject *self, PyTypeObject *cls); static PyObject * zlib_Decompress_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); - goto exit; + return NULL; } - return_value = zlib_Decompress_copy_impl((compobject *)self, cls); - -exit: - return return_value; + return zlib_Decompress_copy_impl((compobject *)self, cls); } #endif /* defined(HAVE_ZLIB_COPY) */ @@ -783,16 +768,11 @@ zlib_Decompress___copy___impl(compobject *self, PyTypeObject *cls); static PyObject * zlib_Decompress___copy__(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "__copy__() takes no arguments"); - goto exit; + return NULL; } - return_value = zlib_Decompress___copy___impl((compobject *)self, cls); - -exit: - return return_value; + return zlib_Decompress___copy___impl((compobject *)self, cls); } #endif /* defined(HAVE_ZLIB_COPY) */ @@ -1129,4 +1109,4 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */ -/*[clinic end generated code: output=75fc32ea26219e44 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=969872868c303e8a input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index de78015e6c591d..fa105f74c58512 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -222,11 +222,7 @@ bytearray_clear_impl(PyByteArrayObject *self); static PyObject * bytearray_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = bytearray_clear_impl((PyByteArrayObject *)self); - - return return_value; + return bytearray_clear_impl((PyByteArrayObject *)self); } PyDoc_STRVAR(bytearray_copy__doc__, @@ -1791,10 +1787,6 @@ bytearray_sizeof_impl(PyByteArrayObject *self); static PyObject * bytearray_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = bytearray_sizeof_impl((PyByteArrayObject *)self); - - return return_value; + return bytearray_sizeof_impl((PyByteArrayObject *)self); } -/*[clinic end generated code: output=e5c4d4489ac7d6a4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7c924a56e0a8bfe6 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index cbc0f955c73fe4..11cb81a9c5c9d7 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -24,11 +24,7 @@ bytes___bytes___impl(PyBytesObject *self); static PyObject * bytes___bytes__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = bytes___bytes___impl((PyBytesObject *)self); - - return return_value; + return bytes___bytes___impl((PyBytesObject *)self); } PyDoc_STRVAR(bytes_split__doc__, @@ -1408,4 +1404,4 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=e9ae159473126636 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=61cb2cf6506df4c6 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/classobject.c.h b/Objects/clinic/classobject.c.h index 7589b2e8316f66..5934f1c2a41669 100644 --- a/Objects/clinic/classobject.c.h +++ b/Objects/clinic/classobject.c.h @@ -18,11 +18,7 @@ method___reduce___impl(PyMethodObject *self); static PyObject * method___reduce__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = method___reduce___impl((PyMethodObject *)self); - - return return_value; + return method___reduce___impl((PyMethodObject *)self); } PyDoc_STRVAR(method_new__doc__, @@ -86,4 +82,4 @@ instancemethod_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=d6078cc5f501c317 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ab546abf90aac94e input=a9049054013a1b77]*/ diff --git a/Objects/clinic/complexobject.c.h b/Objects/clinic/complexobject.c.h index 9dd7a78ba6a87b..e00da1d960c54d 100644 --- a/Objects/clinic/complexobject.c.h +++ b/Objects/clinic/complexobject.c.h @@ -23,11 +23,7 @@ complex_conjugate_impl(PyComplexObject *self); static PyObject * complex_conjugate(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = complex_conjugate_impl((PyComplexObject *)self); - - return return_value; + return complex_conjugate_impl((PyComplexObject *)self); } PyDoc_STRVAR(complex___getnewargs____doc__, @@ -44,11 +40,7 @@ complex___getnewargs___impl(PyComplexObject *self); static PyObject * complex___getnewargs__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = complex___getnewargs___impl((PyComplexObject *)self); - - return return_value; + return complex___getnewargs___impl((PyComplexObject *)self); } PyDoc_STRVAR(complex___format____doc__, @@ -95,11 +87,7 @@ complex___complex___impl(PyComplexObject *self); static PyObject * complex___complex__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = complex___complex___impl((PyComplexObject *)self); - - return return_value; + return complex___complex___impl((PyComplexObject *)self); } PyDoc_STRVAR(complex_new__doc__, @@ -182,4 +170,4 @@ PyDoc_STRVAR(complex_from_number__doc__, #define COMPLEX_FROM_NUMBER_METHODDEF \ {"from_number", (PyCFunction)complex_from_number, METH_O|METH_CLASS, complex_from_number__doc__}, -/*[clinic end generated code: output=9fe5ed58655d9f90 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=252cddef7f9169a0 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h index 9fb28ae1bb61e0..36da98f7477d59 100644 --- a/Objects/clinic/dictobject.c.h +++ b/Objects/clinic/dictobject.c.h @@ -54,11 +54,7 @@ dict_copy_impl(PyDictObject *self); static PyObject * dict_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = dict_copy_impl((PyDictObject *)self); - - return return_value; + return dict_copy_impl((PyDictObject *)self); } PyDoc_STRVAR(dict___contains____doc__, @@ -171,11 +167,7 @@ dict_clear_impl(PyDictObject *self); static PyObject * dict_clear(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = dict_clear_impl((PyDictObject *)self); - - return return_value; + return dict_clear_impl((PyDictObject *)self); } PyDoc_STRVAR(dict_pop__doc__, @@ -257,11 +249,7 @@ dict___sizeof___impl(PyDictObject *self); static PyObject * dict___sizeof__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = dict___sizeof___impl((PyDictObject *)self); - - return return_value; + return dict___sizeof___impl((PyDictObject *)self); } PyDoc_STRVAR(dict___reversed____doc__, @@ -279,11 +267,7 @@ dict___reversed___impl(PyDictObject *self); static PyObject * dict___reversed__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = dict___reversed___impl((PyDictObject *)self); - - return return_value; + return dict___reversed___impl((PyDictObject *)self); } PyDoc_STRVAR(dict_keys__doc__, @@ -301,11 +285,7 @@ dict_keys_impl(PyDictObject *self); static PyObject * dict_keys(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = dict_keys_impl((PyDictObject *)self); - - return return_value; + return dict_keys_impl((PyDictObject *)self); } PyDoc_STRVAR(dict_items__doc__, @@ -323,11 +303,7 @@ dict_items_impl(PyDictObject *self); static PyObject * dict_items(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = dict_items_impl((PyDictObject *)self); - - return return_value; + return dict_items_impl((PyDictObject *)self); } PyDoc_STRVAR(dict_values__doc__, @@ -345,10 +321,6 @@ dict_values_impl(PyDictObject *self); static PyObject * dict_values(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = dict_values_impl((PyDictObject *)self); - - return return_value; + return dict_values_impl((PyDictObject *)self); } -/*[clinic end generated code: output=e5b485fd066e3751 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8a104741e4676c76 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/listobject.c.h b/Objects/clinic/listobject.c.h index 3b5a386011daf5..3f4e7e72f85dc2 100644 --- a/Objects/clinic/listobject.c.h +++ b/Objects/clinic/listobject.c.h @@ -446,11 +446,7 @@ list___sizeof___impl(PyListObject *self); static PyObject * list___sizeof__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = list___sizeof___impl((PyListObject *)self); - - return return_value; + return list___sizeof___impl((PyListObject *)self); } PyDoc_STRVAR(list___reversed____doc__, @@ -468,10 +464,6 @@ list___reversed___impl(PyListObject *self); static PyObject * list___reversed__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = list___reversed___impl((PyListObject *)self); - - return return_value; + return list___reversed___impl((PyListObject *)self); } -/*[clinic end generated code: output=7047af1e69fd9d18 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bc45e43a621ac833 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/memoryobject.c.h b/Objects/clinic/memoryobject.c.h index fafc98a78be7b7..3d9a94665d6fc8 100644 --- a/Objects/clinic/memoryobject.c.h +++ b/Objects/clinic/memoryobject.c.h @@ -139,11 +139,7 @@ memoryview_release_impl(PyMemoryViewObject *self); static PyObject * memoryview_release(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = memoryview_release_impl((PyMemoryViewObject *)self); - - return return_value; + return memoryview_release_impl((PyMemoryViewObject *)self); } PyDoc_STRVAR(memoryview_cast__doc__, @@ -229,11 +225,7 @@ memoryview_toreadonly_impl(PyMemoryViewObject *self); static PyObject * memoryview_toreadonly(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = memoryview_toreadonly_impl((PyMemoryViewObject *)self); - - return return_value; + return memoryview_toreadonly_impl((PyMemoryViewObject *)self); } PyDoc_STRVAR(memoryview_tolist__doc__, @@ -251,11 +243,7 @@ memoryview_tolist_impl(PyMemoryViewObject *self); static PyObject * memoryview_tolist(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = memoryview_tolist_impl((PyMemoryViewObject *)self); - - return return_value; + return memoryview_tolist_impl((PyMemoryViewObject *)self); } PyDoc_STRVAR(memoryview_tobytes__doc__, @@ -498,4 +486,4 @@ memoryview_index(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=37f6fd422ddd18af input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c0371164b68a6839 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/tupleobject.c.h b/Objects/clinic/tupleobject.c.h index fc044de3797206..1c12706c0bb43b 100644 --- a/Objects/clinic/tupleobject.c.h +++ b/Objects/clinic/tupleobject.c.h @@ -125,10 +125,6 @@ tuple___getnewargs___impl(PyTupleObject *self); static PyObject * tuple___getnewargs__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = tuple___getnewargs___impl((PyTupleObject *)self); - - return return_value; + return tuple___getnewargs___impl((PyTupleObject *)self); } -/*[clinic end generated code: output=7d7754943df5c955 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bd11662d62d973c2 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typeobject.c.h b/Objects/clinic/typeobject.c.h index 90d4eb7c47283e..24a25f27ea3cc3 100644 --- a/Objects/clinic/typeobject.c.h +++ b/Objects/clinic/typeobject.c.h @@ -75,11 +75,7 @@ type_mro_impl(PyTypeObject *self); static PyObject * type_mro(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = type_mro_impl((PyTypeObject *)self); - - return return_value; + return type_mro_impl((PyTypeObject *)self); } PyDoc_STRVAR(type___subclasses____doc__, @@ -97,11 +93,7 @@ type___subclasses___impl(PyTypeObject *self); static PyObject * type___subclasses__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = type___subclasses___impl((PyTypeObject *)self); - - return return_value; + return type___subclasses___impl((PyTypeObject *)self); } PyDoc_STRVAR(type___dir____doc__, @@ -119,11 +111,7 @@ type___dir___impl(PyTypeObject *self); static PyObject * type___dir__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = type___dir___impl((PyTypeObject *)self); - - return return_value; + return type___dir___impl((PyTypeObject *)self); } PyDoc_STRVAR(type___sizeof____doc__, @@ -141,11 +129,7 @@ type___sizeof___impl(PyTypeObject *self); static PyObject * type___sizeof__(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = type___sizeof___impl((PyTypeObject *)self); - - return return_value; + return type___sizeof___impl((PyTypeObject *)self); } PyDoc_STRVAR(object___getstate____doc__, @@ -278,4 +262,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return object___dir___impl(self); } -/*[clinic end generated code: output=bfa1e3547f298bbe input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b55c0d257e2518d2 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typevarobject.c.h b/Objects/clinic/typevarobject.c.h index e95f61303cb5fb..87e0fd77203f75 100644 --- a/Objects/clinic/typevarobject.c.h +++ b/Objects/clinic/typevarobject.c.h @@ -187,11 +187,7 @@ typevar_reduce_impl(typevarobject *self); static PyObject * typevar_reduce(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = typevar_reduce_impl((typevarobject *)self); - - return return_value; + return typevar_reduce_impl((typevarobject *)self); } PyDoc_STRVAR(typevar_has_default__doc__, @@ -208,11 +204,7 @@ typevar_has_default_impl(typevarobject *self); static PyObject * typevar_has_default(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = typevar_has_default_impl((typevarobject *)self); - - return return_value; + return typevar_has_default_impl((typevarobject *)self); } PyDoc_STRVAR(paramspecargs_new__doc__, @@ -496,11 +488,7 @@ paramspec_reduce_impl(paramspecobject *self); static PyObject * paramspec_reduce(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = paramspec_reduce_impl((paramspecobject *)self); - - return return_value; + return paramspec_reduce_impl((paramspecobject *)self); } PyDoc_STRVAR(paramspec_has_default__doc__, @@ -517,11 +505,7 @@ paramspec_has_default_impl(paramspecobject *self); static PyObject * paramspec_has_default(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = paramspec_has_default_impl((paramspecobject *)self); - - return return_value; + return paramspec_has_default_impl((paramspecobject *)self); } PyDoc_STRVAR(typevartuple__doc__, @@ -656,11 +640,7 @@ typevartuple_reduce_impl(typevartupleobject *self); static PyObject * typevartuple_reduce(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = typevartuple_reduce_impl((typevartupleobject *)self); - - return return_value; + return typevartuple_reduce_impl((typevartupleobject *)self); } PyDoc_STRVAR(typevartuple_has_default__doc__, @@ -677,11 +657,7 @@ typevartuple_has_default_impl(typevartupleobject *self); static PyObject * typevartuple_has_default(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = typevartuple_has_default_impl((typevartupleobject *)self); - - return return_value; + return typevartuple_has_default_impl((typevartupleobject *)self); } PyDoc_STRVAR(typealias_reduce__doc__, @@ -698,11 +674,7 @@ typealias_reduce_impl(typealiasobject *self); static PyObject * typealias_reduce(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = typealias_reduce_impl((typealiasobject *)self); - - return return_value; + return typealias_reduce_impl((typealiasobject *)self); } PyDoc_STRVAR(typealias_new__doc__, @@ -773,4 +745,4 @@ typealias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=d3ce5c26c77401c0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d0cdf708e2e315a4 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index d81fd2858b6c44..99651f3c64bc5a 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -24,11 +24,7 @@ EncodingMap_size_impl(struct encoding_map *self); static PyObject * EncodingMap_size(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = EncodingMap_size_impl((struct encoding_map *)self); - - return return_value; + return EncodingMap_size_impl((struct encoding_map *)self); } PyDoc_STRVAR(unicode_title__doc__, @@ -1898,4 +1894,4 @@ unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=5b50c21ec6f9cd28 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=db37497bf38a2c17 input=a9049054013a1b77]*/ diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index 35db5e446735fa..00fa6a75ec113e 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -28,11 +28,7 @@ winreg_HKEYType_Close_impl(PyHKEYObject *self); static PyObject * winreg_HKEYType_Close(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = winreg_HKEYType_Close_impl((PyHKEYObject *)self); - - return return_value; + return winreg_HKEYType_Close_impl((PyHKEYObject *)self); } #endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES)) */ @@ -62,11 +58,7 @@ winreg_HKEYType_Detach_impl(PyHKEYObject *self); static PyObject * winreg_HKEYType_Detach(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = winreg_HKEYType_Detach_impl((PyHKEYObject *)self); - - return return_value; + return winreg_HKEYType_Detach_impl((PyHKEYObject *)self); } #endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES)) */ @@ -1774,4 +1766,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) #ifndef WINREG_QUERYREFLECTIONKEY_METHODDEF #define WINREG_QUERYREFLECTIONKEY_METHODDEF #endif /* !defined(WINREG_QUERYREFLECTIONKEY_METHODDEF) */ -/*[clinic end generated code: output=b63cab45ed1e83c6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fbe9b075cd2fa833 input=a9049054013a1b77]*/ diff --git a/Python/clinic/context.c.h b/Python/clinic/context.c.h index 128482abc1b981..5ed74e6e6ddb6b 100644 --- a/Python/clinic/context.c.h +++ b/Python/clinic/context.c.h @@ -59,11 +59,7 @@ _contextvars_Context_items_impl(PyContext *self); static PyObject * _contextvars_Context_items(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _contextvars_Context_items_impl((PyContext *)self); - - return return_value; + return _contextvars_Context_items_impl((PyContext *)self); } PyDoc_STRVAR(_contextvars_Context_keys__doc__, @@ -81,11 +77,7 @@ _contextvars_Context_keys_impl(PyContext *self); static PyObject * _contextvars_Context_keys(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _contextvars_Context_keys_impl((PyContext *)self); - - return return_value; + return _contextvars_Context_keys_impl((PyContext *)self); } PyDoc_STRVAR(_contextvars_Context_values__doc__, @@ -103,11 +95,7 @@ _contextvars_Context_values_impl(PyContext *self); static PyObject * _contextvars_Context_values(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _contextvars_Context_values_impl((PyContext *)self); - - return return_value; + return _contextvars_Context_values_impl((PyContext *)self); } PyDoc_STRVAR(_contextvars_Context_copy__doc__, @@ -125,11 +113,7 @@ _contextvars_Context_copy_impl(PyContext *self); static PyObject * _contextvars_Context_copy(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = _contextvars_Context_copy_impl((PyContext *)self); - - return return_value; + return _contextvars_Context_copy_impl((PyContext *)self); } PyDoc_STRVAR(_contextvars_ContextVar_get__doc__, @@ -237,11 +221,7 @@ token_enter_impl(PyContextToken *self); static PyObject * token_enter(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = token_enter_impl((PyContextToken *)self); - - return return_value; + return token_enter_impl((PyContextToken *)self); } PyDoc_STRVAR(token_exit__doc__, @@ -276,4 +256,4 @@ token_exit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=65cc35e46da68d51 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3a04b2fddf24c3e9 input=a9049054013a1b77]*/ diff --git a/Python/clinic/instruction_sequence.c.h b/Python/clinic/instruction_sequence.c.h index a5c49b7daea7d0..41ab2de44e426e 100644 --- a/Python/clinic/instruction_sequence.c.h +++ b/Python/clinic/instruction_sequence.c.h @@ -284,11 +284,7 @@ InstructionSequenceType_get_nested_impl(_PyInstructionSequence *self); static PyObject * InstructionSequenceType_get_nested(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = InstructionSequenceType_get_nested_impl((_PyInstructionSequence *)self); - - return return_value; + return InstructionSequenceType_get_nested_impl((_PyInstructionSequence *)self); } PyDoc_STRVAR(InstructionSequenceType_get_instructions__doc__, @@ -306,10 +302,6 @@ InstructionSequenceType_get_instructions_impl(_PyInstructionSequence *self); static PyObject * InstructionSequenceType_get_instructions(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = InstructionSequenceType_get_instructions_impl((_PyInstructionSequence *)self); - - return return_value; + return InstructionSequenceType_get_instructions_impl((_PyInstructionSequence *)self); } -/*[clinic end generated code: output=fb0f15c2a0805a72 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e6b5d05bde008cc2 input=a9049054013a1b77]*/ diff --git a/Tools/clinic/libclinic/parse_args.py b/Tools/clinic/libclinic/parse_args.py index 56616eccd7cc9b..b3fb765e31af47 100644 --- a/Tools/clinic/libclinic/parse_args.py +++ b/Tools/clinic/libclinic/parse_args.py @@ -292,11 +292,13 @@ def use_meth_o(self) -> bool: and not self.is_new_or_init()) def use_simple_return(self) -> bool: - pyobject = 'PyObject *' - return (self.func.return_converter.type == pyobject - and not self.func.critical_section - and self.self_parameter_converter.type in (pyobject, None) - and self.self_parameter_converter.specified_type in (pyobject, None)) + return (self.func.return_converter.type == 'PyObject *' + and not self.func.critical_section) + + def use_pyobject_self(self) -> bool: + pyobject_types = ('PyObject *', None) + return (self.self_parameter_converter.type in pyobject_types + and self.self_parameter_converter.specified_type in pyobject_types) def select_prototypes(self) -> None: self.docstring_prototype = '' @@ -408,7 +410,7 @@ def parse_one_arg(self) -> None: self.converters[0].format_unit == 'O'): meth_o_prototype = METH_O_PROTOTYPE - if self.use_simple_return(): + if self.use_simple_return() and self.use_pyobject_self(): # maps perfectly to METH_O, doesn't need a return converter. # so we skip making a parse function # and call directly into the impl function. From 8b09a8a1ee94e998fe58e5640098a92aa21123c3 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 10 Mar 2025 17:16:51 +0100 Subject: [PATCH 9/9] Run make clinic-tests --- Lib/test/clinic.test.c | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/Lib/test/clinic.test.c b/Lib/test/clinic.test.c index 41b05905589294..2f843371ff9d7c 100644 --- a/Lib/test/clinic.test.c +++ b/Lib/test/clinic.test.c @@ -4910,21 +4910,16 @@ Test_cls_no_params_impl(TestObj *self, PyTypeObject *cls); static PyObject * Test_cls_no_params(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - PyObject *return_value = NULL; - if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "cls_no_params() takes no arguments"); - goto exit; + return NULL; } - return_value = Test_cls_no_params_impl((TestObj *)self, cls); - -exit: - return return_value; + return Test_cls_no_params_impl((TestObj *)self, cls); } static PyObject * Test_cls_no_params_impl(TestObj *self, PyTypeObject *cls) -/*[clinic end generated code: output=70c0b4bfb2ea3bab input=e7e2e4e344e96a11]*/ +/*[clinic end generated code: output=8845de054449f40a input=e7e2e4e344e96a11]*/ /*[clinic input] @@ -5296,16 +5291,12 @@ Test_meth_coexist_impl(TestObj *self); static PyObject * Test_meth_coexist(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyObject *return_value = NULL; - - return_value = Test_meth_coexist_impl((TestObj *)self); - - return return_value; + return Test_meth_coexist_impl((TestObj *)self); } static PyObject * Test_meth_coexist_impl(TestObj *self) -/*[clinic end generated code: output=09e0fbba4ffb08df input=2a1d75b5e6fec6dd]*/ +/*[clinic end generated code: output=7edf4e95b29f06fa input=2a1d75b5e6fec6dd]*/ /*[clinic input] @getter @@ -5328,16 +5319,12 @@ Test_property_get_impl(TestObj *self); static PyObject * Test_property_get(PyObject *self, void *Py_UNUSED(context)) { - PyObject *return_value = NULL; - - return_value = Test_property_get_impl((TestObj *)self); - - return return_value; + return Test_property_get_impl((TestObj *)self); } static PyObject * Test_property_get_impl(TestObj *self) -/*[clinic end generated code: output=117f470c76def2b0 input=2d92b3449fbc7d2b]*/ +/*[clinic end generated code: output=b38d68abd3466a6e input=2d92b3449fbc7d2b]*/ /*[clinic input] @setter @@ -5433,16 +5420,12 @@ Test_setter_first_with_docstr_get_impl(TestObj *self); static PyObject * Test_setter_first_with_docstr_get(PyObject *self, void *Py_UNUSED(context)) { - PyObject *return_value = NULL; - - return_value = Test_setter_first_with_docstr_get_impl((TestObj *)self); - - return return_value; + return Test_setter_first_with_docstr_get_impl((TestObj *)self); } static PyObject * Test_setter_first_with_docstr_get_impl(TestObj *self) -/*[clinic end generated code: output=ee74b65390f451f6 input=10af4e43b3cb34dc]*/ +/*[clinic end generated code: output=fe6e3aa844a24920 input=10af4e43b3cb34dc]*/ /*[clinic input] output push