@@ -970,44 +970,44 @@ _io_StringIO___setstate___impl(stringio *self, PyObject *state)
970
970
Py_RETURN_NONE ;
971
971
}
972
972
973
+ /*[clinic input]
974
+ @critical_section
975
+ @getter
976
+ _io.StringIO.closed
977
+ [clinic start generated code]*/
973
978
974
979
static PyObject *
975
- stringio_closed_impl (stringio * self , void * context )
980
+ _io_StringIO_closed_get_impl (stringio * self )
981
+ /*[clinic end generated code: output=531ddca7954331d6 input=178d2ef24395fd49]*/
976
982
{
977
983
CHECK_INITIALIZED (self );
978
984
return PyBool_FromLong (self -> closed );
979
985
}
980
986
981
- static PyObject *
982
- stringio_closed (stringio * self , void * context )
983
- {
984
- PyObject * result ;
985
- Py_BEGIN_CRITICAL_SECTION (self );
986
- result = stringio_closed_impl (self , context );
987
- Py_END_CRITICAL_SECTION ();
988
- return result ;
989
- }
987
+ /*[clinic input]
988
+ @critical_section
989
+ @getter
990
+ _io.StringIO.line_buffering
991
+ [clinic start generated code]*/
990
992
991
993
static PyObject *
992
- stringio_line_buffering_impl (stringio * self , void * context )
994
+ _io_StringIO_line_buffering_get_impl (stringio * self )
995
+ /*[clinic end generated code: output=360710e0112966ae input=6a7634e7f890745e]*/
993
996
{
994
997
CHECK_INITIALIZED (self );
995
998
CHECK_CLOSED (self );
996
999
Py_RETURN_FALSE ;
997
1000
}
998
1001
999
- static PyObject *
1000
- stringio_line_buffering (stringio * self , void * context )
1001
- {
1002
- PyObject * result ;
1003
- Py_BEGIN_CRITICAL_SECTION (self );
1004
- result = stringio_line_buffering_impl (self , context );
1005
- Py_END_CRITICAL_SECTION ();
1006
- return result ;
1007
- }
1002
+ /*[clinic input]
1003
+ @critical_section
1004
+ @getter
1005
+ _io.StringIO.newlines
1006
+ [clinic start generated code]*/
1008
1007
1009
1008
static PyObject *
1010
- stringio_newlines_impl (stringio * self , void * context )
1009
+ _io_StringIO_newlines_get_impl (stringio * self )
1010
+ /*[clinic end generated code: output=35d7c0b66d7e0160 input=092a14586718244b]*/
1011
1011
{
1012
1012
CHECK_INITIALIZED (self );
1013
1013
CHECK_CLOSED (self );
@@ -1017,16 +1017,6 @@ stringio_newlines_impl(stringio *self, void *context)
1017
1017
return PyObject_GetAttr (self -> decoder , & _Py_ID (newlines ));
1018
1018
}
1019
1019
1020
- static PyObject *
1021
- stringio_newlines (stringio * self , void * context )
1022
- {
1023
- PyObject * result ;
1024
- Py_BEGIN_CRITICAL_SECTION (self );
1025
- result = stringio_newlines_impl (self , context );
1026
- Py_END_CRITICAL_SECTION ();
1027
- return result ;
1028
- }
1029
-
1030
1020
static struct PyMethodDef stringio_methods [] = {
1031
1021
_IO_STRINGIO_CLOSE_METHODDEF
1032
1022
_IO_STRINGIO_GETVALUE_METHODDEF
@@ -1047,15 +1037,15 @@ static struct PyMethodDef stringio_methods[] = {
1047
1037
};
1048
1038
1049
1039
static PyGetSetDef stringio_getset [] = {
1050
- { "closed" , ( getter ) stringio_closed , NULL , NULL },
1051
- { "newlines" , ( getter ) stringio_newlines , NULL , NULL },
1040
+ _IO_STRINGIO_CLOSED_GETTERDEF
1041
+ _IO_STRINGIO_NEWLINES_GETTERDEF
1052
1042
/* (following comments straight off of the original Python wrapper:)
1053
1043
XXX Cruft to support the TextIOWrapper API. This would only
1054
1044
be meaningful if StringIO supported the buffer attribute.
1055
1045
Hopefully, a better solution, than adding these pseudo-attributes,
1056
1046
will be found.
1057
1047
*/
1058
- { "line_buffering" , ( getter ) stringio_line_buffering , NULL , NULL },
1048
+ _IO_STRINGIO_LINE_BUFFERING_GETTERDEF
1059
1049
{NULL }
1060
1050
};
1061
1051
0 commit comments