diff options
Diffstat (limited to 'Modules/_csv.c')
-rw-r--r-- | Modules/_csv.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c index e5324ae..fb5530a 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -152,8 +152,7 @@ static PyObject * get_nullchar_as_None(Py_UCS4 c) { if (c == '\0') { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } else return PyUnicode_FromOrdinal(c); @@ -1294,8 +1293,7 @@ csv_writerows(WriterObj *self, PyObject *seqseq) Py_DECREF(row_iter); if (PyErr_Occurred()) return NULL; - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } static struct PyMethodDef Writer_methods[] = { @@ -1450,8 +1448,7 @@ csv_register_dialect(PyObject *module, PyObject *args, PyObject *kwargs) return NULL; } Py_DECREF(dialect); - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } static PyObject * @@ -1459,8 +1456,7 @@ csv_unregister_dialect(PyObject *module, PyObject *name_obj) { if (PyDict_DelItem(_csvstate_global->dialects, name_obj) < 0) return PyErr_Format(_csvstate_global->error_obj, "unknown dialect"); - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } static PyObject * |