@@ -111,7 +111,7 @@ static PyTypeObject Reader_Type;
111
111
typedef struct {
112
112
PyObject_HEAD
113
113
114
- PyObject * writeline ; /* write output lines to this file */
114
+ PyObject * write ; /* write output lines to this file */
115
115
116
116
DialectObj * dialect ; /* parsing dialect */
117
117
@@ -1231,14 +1231,16 @@ csv_writerow(WriterObj *self, PyObject *seq)
1231
1231
1232
1232
/* Add line terminator.
1233
1233
*/
1234
- if (!join_append_lineterminator (self ))
1234
+ if (!join_append_lineterminator (self )) {
1235
1235
return NULL ;
1236
+ }
1236
1237
1237
1238
line = PyUnicode_FromKindAndData (PyUnicode_4BYTE_KIND ,
1238
1239
(void * ) self -> rec , self -> rec_len );
1239
- if (line == NULL )
1240
+ if (line == NULL ) {
1240
1241
return NULL ;
1241
- result = PyObject_CallFunctionObjArgs (self -> writeline , line , NULL );
1242
+ }
1243
+ result = PyObject_CallFunctionObjArgs (self -> write , line , NULL );
1242
1244
Py_DECREF (line );
1243
1245
return result ;
1244
1246
}
@@ -1294,7 +1296,7 @@ Writer_dealloc(WriterObj *self)
1294
1296
{
1295
1297
PyObject_GC_UnTrack (self );
1296
1298
Py_XDECREF (self -> dialect );
1297
- Py_XDECREF (self -> writeline );
1299
+ Py_XDECREF (self -> write );
1298
1300
if (self -> rec != NULL )
1299
1301
PyMem_Free (self -> rec );
1300
1302
PyObject_GC_Del (self );
@@ -1304,15 +1306,15 @@ static int
1304
1306
Writer_traverse (WriterObj * self , visitproc visit , void * arg )
1305
1307
{
1306
1308
Py_VISIT (self -> dialect );
1307
- Py_VISIT (self -> writeline );
1309
+ Py_VISIT (self -> write );
1308
1310
return 0 ;
1309
1311
}
1310
1312
1311
1313
static int
1312
1314
Writer_clear (WriterObj * self )
1313
1315
{
1314
1316
Py_CLEAR (self -> dialect );
1315
- Py_CLEAR (self -> writeline );
1317
+ Py_CLEAR (self -> write );
1316
1318
return 0 ;
1317
1319
}
1318
1320
@@ -1369,7 +1371,7 @@ csv_writer(PyObject *module, PyObject *args, PyObject *keyword_args)
1369
1371
return NULL ;
1370
1372
1371
1373
self -> dialect = NULL ;
1372
- self -> writeline = NULL ;
1374
+ self -> write = NULL ;
1373
1375
1374
1376
self -> rec = NULL ;
1375
1377
self -> rec_size = 0 ;
@@ -1380,8 +1382,8 @@ csv_writer(PyObject *module, PyObject *args, PyObject *keyword_args)
1380
1382
Py_DECREF (self );
1381
1383
return NULL ;
1382
1384
}
1383
- self -> writeline = _PyObject_GetAttrId (output_file , & PyId_write );
1384
- if (self -> writeline == NULL || !PyCallable_Check (self -> writeline )) {
1385
+ self -> write = _PyObject_GetAttrId (output_file , & PyId_write );
1386
+ if (self -> write == NULL || !PyCallable_Check (self -> write )) {
1385
1387
PyErr_SetString (PyExc_TypeError ,
1386
1388
"argument 1 must have a \"write\" method" );
1387
1389
Py_DECREF (self );
0 commit comments