Skip to content

Commit 384d6c1

Browse files
committed
Update
1 parent 488a127 commit 384d6c1

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

Lib/test/clinic.test.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -4988,18 +4988,18 @@ Test.property
49884988
# define TEST_PROPERTY_GETSETTERDEF {"property", NULL, (setter)Test_property_set, NULL},
49894989
#endif
49904990

4991-
static PyObject *
4991+
static int
49924992
Test_property_set_impl(TestObj *self, PyObject *value);
49934993

4994-
static PyObject *
4994+
static int
49954995
Test_property_set(TestObj *self, PyObject *value, void *Py_UNUSED(context))
49964996
{
49974997
return Test_property_set_impl(self, value);
49984998
}
49994999

5000-
static PyObject *
5000+
static int
50015001
Test_property_set_impl(TestObj *self, PyObject *value)
5002-
/*[clinic end generated code: output=2ba2d4de6020e191 input=3bc3f46a23c83a88]*/
5002+
/*[clinic end generated code: output=e57ae784a4e3382a input=3bc3f46a23c83a88]*/
50035003

50045004
/*[clinic input]
50055005
output push

Modules/_io/clinic/textio.c.h

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_io/textio.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3258,9 +3258,9 @@ _io_TextIOWrapper__CHUNK_SIZE_get_impl(textio *self)
32583258
_io.TextIOWrapper._CHUNK_SIZE
32593259
[clinic start generated code]*/
32603260

3261-
static PyObject *
3261+
static int
32623262
_io_TextIOWrapper__CHUNK_SIZE_set_impl(textio *self, PyObject *value)
3263-
/*[clinic end generated code: output=0d4fc49ae6b8eb87 input=32fc99861db02a0a]*/
3263+
/*[clinic end generated code: output=edb86d2db660a5ab input=32fc99861db02a0a]*/
32643264
{
32653265
Py_ssize_t n;
32663266
CHECK_ATTACHED_INT(self);

Tools/clinic/clinic.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ class CLanguage(Language):
851851
{c_basename}({self_type}{self_name}, void *Py_UNUSED(context))
852852
""")
853853
PARSER_PROTOTYPE_SETTER: Final[str] = normalize_snippet("""
854-
static PyObject *
854+
static int
855855
{c_basename}({self_type}{self_name}, PyObject *value, void *Py_UNUSED(context))
856856
""")
857857
METH_O_PROTOTYPE: Final[str] = normalize_snippet("""
@@ -1189,6 +1189,7 @@ def output_templates(
11891189
methoddef_define = self.GETTERDEF_PROTOTYPE_DEFINE
11901190
docstring_prototype = docstring_definition = ''
11911191
elif f.kind is SETTER:
1192+
return_value_declaration = "int return_value;"
11921193
methoddef_define = self.SETTERDEF_PROTOTYPE_DEFINE
11931194
docstring_prototype = docstring_prototype = docstring_definition = ''
11941195
else:
@@ -1992,7 +1993,10 @@ def render_function(
19921993
converter.set_template_dict(template_dict)
19931994

19941995
f.return_converter.render(f, data)
1995-
template_dict['impl_return_type'] = f.return_converter.type
1996+
if f.kind is SETTER:
1997+
template_dict['impl_return_type'] = 'int'
1998+
else:
1999+
template_dict['impl_return_type'] = f.return_converter.type
19962000

19972001
template_dict['declarations'] = format_escape("\n".join(data.declarations))
19982002
template_dict['initializers'] = "\n\n".join(data.initializers)

0 commit comments

Comments
 (0)