File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1286,17 +1286,19 @@ csv_writerow(PyObject *op, PyObject *seq)
12861286 case QUOTE_NOTNULL :
12871287 quoted = !is_none ;
12881288 break ;
1289- default : /* Default QUOTE_MINIMAL or other to minimal behavior */
1289+ default :
12901290 quoted = 0 ;
12911291 break ;
12921292 }
12931293
12941294 if (is_none ) {
12951295 /* None is NULL. */
12961296 str_field = NULL ;
1297- } else if (PyUnicode_Check (field )) {
1297+ }
1298+ else if (PyUnicode_Check (field )) {
12981299 str_field = Py_NewRef (field );
1299- } else {
1300+ }
1301+ else {
13001302 str_field = PyObject_Str (field );
13011303 if (str_field == NULL ) {
13021304 Py_DECREF (field );
@@ -1309,13 +1311,13 @@ csv_writerow(PyObject *op, PyObject *seq)
13091311 first_field_was_none = is_none ;
13101312 if (is_none ) {
13111313 first_field_was_empty_like = true;
1312- } else {
1314+ }
1315+ else {
13131316 Py_ssize_t len = str_field ? PyUnicode_GET_LENGTH (str_field ) : 0 ;
13141317 first_field_was_empty_like = (len == 0 );
13151318 }
13161319 }
13171320
1318- /* Important side-effect: this may promote to "quoted". */
13191321 if (_write_field (writer , self , str_field , & quoted ) < 0 ) {
13201322 Py_XDECREF (str_field );
13211323 Py_DECREF (field );
You can’t perform that action at this time.
0 commit comments