diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-23 07:47:21 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-23 07:47:21 (GMT) |
commit | 228b12edcce49649d6befa3c03dbcefd5a22ae76 (patch) | |
tree | 1066be6909fb981fcf30e1a8e224d43567bd9b92 /Modules/_csv.c | |
parent | 60e6e962bac6a668d0df539ebf526a0a1c69eacd (diff) | |
download | cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.zip cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.tar.gz cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.tar.bz2 |
Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
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 * |