File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1340,8 +1340,7 @@ csv_writerow(PyObject *op, PyObject *seq)
13401340 dialect -> quoting == QUOTE_NOTNULL ))) {
13411341 PyErr_SetString (self -> error_obj ,
13421342 "single empty field record must be quoted" );
1343- PyUnicodeWriter_Discard (writer );
1344- return NULL ;
1343+ goto error_after_iter ;
13451344 }
13461345 if (PyUnicodeWriter_WriteChar (writer , dialect -> quotechar ) < 0 ) {
13471346 goto error_after_iter ;
@@ -1352,9 +1351,7 @@ csv_writerow(PyObject *op, PyObject *seq)
13521351 }
13531352
13541353 if (PyUnicodeWriter_WriteStr (writer , self -> dialect -> lineterminator ) < 0 ) {
1355- error_after_iter :
1356- PyUnicodeWriter_Discard (writer );
1357- return NULL ;
1354+ goto error_after_iter ;
13581355 }
13591356
13601357 line = PyUnicodeWriter_Finish (writer );
@@ -1368,6 +1365,7 @@ csv_writerow(PyObject *op, PyObject *seq)
13681365
13691366error :
13701367 Py_XDECREF (iter );
1368+ error_after_iter :
13711369 PyUnicodeWriter_Discard (writer );
13721370 return NULL ;
13731371}
You can’t perform that action at this time.
0 commit comments