@@ -1475,7 +1475,7 @@ textiowrapper_traverse(textio *self, visitproc visit, void *arg)
1475
1475
}
1476
1476
1477
1477
static PyObject *
1478
- textiowrapper_closed_get (textio * self , void * context );
1478
+ _io_TextIOWrapper_closed_get_impl (textio * self );
1479
1479
1480
1480
/* This macro takes some shortcuts to make the common case faster. */
1481
1481
#define CHECK_CLOSED (self ) \
@@ -1486,7 +1486,7 @@ textiowrapper_closed_get(textio *self, void *context);
1486
1486
if (self->raw != NULL) \
1487
1487
r = _PyFileIO_closed(self->raw); \
1488
1488
else { \
1489
- _res = textiowrapper_closed_get (self, NULL ); \
1489
+ _res = _io_TextIOWrapper_closed_get_impl (self); \
1490
1490
if (_res == NULL) \
1491
1491
return NULL; \
1492
1492
r = PyObject_IsTrue(_res); \
@@ -3090,7 +3090,7 @@ _io_TextIOWrapper_close_impl(textio *self)
3090
3090
int r ;
3091
3091
CHECK_ATTACHED (self );
3092
3092
3093
- res = textiowrapper_closed_get (self , NULL );
3093
+ res = _io_TextIOWrapper_closed_get_impl (self );
3094
3094
if (res == NULL )
3095
3095
return NULL ;
3096
3096
r = PyObject_IsTrue (res );
@@ -3164,42 +3164,43 @@ textiowrapper_iternext(textio *self)
3164
3164
return line ;
3165
3165
}
3166
3166
3167
+ /*[clinic input]
3168
+ @critical_section
3169
+ @getter
3170
+ _io.TextIOWrapper.name
3171
+ [clinic start generated code]*/
3172
+
3167
3173
static PyObject *
3168
- textiowrapper_name_get_impl (textio * self , void * context )
3174
+ _io_TextIOWrapper_name_get_impl (textio * self )
3175
+ /*[clinic end generated code: output=8c2f1d6d8756af40 input=26ecec9b39e30e07]*/
3169
3176
{
3170
3177
CHECK_ATTACHED (self );
3171
3178
return PyObject_GetAttr (self -> buffer , & _Py_ID (name ));
3172
3179
}
3173
3180
3174
- static PyObject *
3175
- textiowrapper_name_get (textio * self , void * context )
3176
- {
3177
- PyObject * result = NULL ;
3178
- Py_BEGIN_CRITICAL_SECTION (self );
3179
- result = textiowrapper_name_get_impl (self , context );
3180
- Py_END_CRITICAL_SECTION ();
3181
- return result ;
3182
- }
3181
+ /*[clinic input]
3182
+ @critical_section
3183
+ @getter
3184
+ _io.TextIOWrapper.closed
3185
+ [clinic start generated code]*/
3183
3186
3184
3187
static PyObject *
3185
- textiowrapper_closed_get_impl (textio * self , void * context )
3188
+ _io_TextIOWrapper_closed_get_impl (textio * self )
3189
+ /*[clinic end generated code: output=b49b68f443a85e3c input=7dfcf43f63c7003d]*/
3186
3190
{
3187
3191
CHECK_ATTACHED (self );
3188
3192
return PyObject_GetAttr (self -> buffer , & _Py_ID (closed ));
3189
3193
}
3190
3194
3191
- static PyObject *
3192
- textiowrapper_closed_get (textio * self , void * context )
3193
- {
3194
- PyObject * result = NULL ;
3195
- Py_BEGIN_CRITICAL_SECTION (self );
3196
- result = textiowrapper_closed_get_impl (self , context );
3197
- Py_END_CRITICAL_SECTION ();
3198
- return result ;
3199
- }
3195
+ /*[clinic input]
3196
+ @critical_section
3197
+ @getter
3198
+ _io.TextIOWrapper.newlines
3199
+ [clinic start generated code]*/
3200
3200
3201
3201
static PyObject *
3202
- textiowrapper_newlines_get_impl (textio * self , void * context )
3202
+ _io_TextIOWrapper_newlines_get_impl (textio * self )
3203
+ /*[clinic end generated code: output=53aa03ac35573180 input=610df647e514b3e8]*/
3203
3204
{
3204
3205
PyObject * res ;
3205
3206
CHECK_ATTACHED (self );
@@ -3211,33 +3212,20 @@ textiowrapper_newlines_get_impl(textio *self, void *context)
3211
3212
return res ;
3212
3213
}
3213
3214
3214
- static PyObject *
3215
- textiowrapper_newlines_get (textio * self , void * context )
3216
- {
3217
- PyObject * result = NULL ;
3218
- Py_BEGIN_CRITICAL_SECTION (self );
3219
- result = textiowrapper_newlines_get_impl (self , context );
3220
- Py_END_CRITICAL_SECTION ();
3221
- return result ;
3222
- }
3215
+ /*[clinic input]
3216
+ @critical_section
3217
+ @getter
3218
+ _io.TextIOWrapper.errors
3219
+ [clinic start generated code]*/
3223
3220
3224
3221
static PyObject *
3225
- textiowrapper_errors_get_impl (textio * self , void * context )
3222
+ _io_TextIOWrapper_errors_get_impl (textio * self )
3223
+ /*[clinic end generated code: output=dca3a3ef21b09484 input=b45f983e6d43c4d8]*/
3226
3224
{
3227
3225
CHECK_INITIALIZED (self );
3228
3226
return Py_NewRef (self -> errors );
3229
3227
}
3230
3228
3231
- static PyObject *
3232
- textiowrapper_errors_get (textio * self , void * context )
3233
- {
3234
- PyObject * result = NULL ;
3235
- Py_BEGIN_CRITICAL_SECTION (self );
3236
- result = textiowrapper_errors_get_impl (self , context );
3237
- Py_END_CRITICAL_SECTION ();
3238
- return result ;
3239
- }
3240
-
3241
3229
/*[clinic input]
3242
3230
@critical_section
3243
3231
@getter
@@ -3349,12 +3337,12 @@ static PyMemberDef textiowrapper_members[] = {
3349
3337
};
3350
3338
3351
3339
static PyGetSetDef textiowrapper_getset [] = {
3352
- { "name" , ( getter ) textiowrapper_name_get , NULL , NULL },
3353
- { "closed" , ( getter ) textiowrapper_closed_get , NULL , NULL },
3340
+ _IO_TEXTIOWRAPPER_NAME_GETSETDEF
3341
+ _IO_TEXTIOWRAPPER_CLOSED_GETSETDEF
3354
3342
/* {"mode", (getter)TextIOWrapper_mode_get, NULL, NULL},
3355
3343
*/
3356
- { "newlines" , ( getter ) textiowrapper_newlines_get , NULL , NULL },
3357
- { "errors" , ( getter ) textiowrapper_errors_get , NULL , NULL },
3344
+ _IO_TEXTIOWRAPPER_NEWLINES_GETSETDEF
3345
+ _IO_TEXTIOWRAPPER_ERRORS_GETSETDEF
3358
3346
_IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF
3359
3347
{NULL }
3360
3348
};
0 commit comments