From 228b12edcce49649d6befa3c03dbcefd5a22ae76 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 23 Jan 2017 09:47:21 +0200 Subject: Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever possible. Patch is writen with Coccinelle. --- Modules/posixmodule.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'Modules/posixmodule.c') diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d2ff07f691..48c3c7abb4 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1871,8 +1871,7 @@ stat_float_times(PyObject* self, PyObject *args) /* Return old value */ return PyBool_FromLong(_stat_float_times); _stat_float_times = newval; - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } static PyObject *billion = NULL; @@ -6194,8 +6193,7 @@ posix_initgroups(PyObject *self, PyObject *args) if (res == -1) return PyErr_SetFromErrno(PyExc_OSError); - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } #endif /* HAVE_INITGROUPS */ @@ -6258,8 +6256,7 @@ os_setpgrp_impl(PyObject *module) if (setpgrp() < 0) #endif /* SETPGRP_HAVE_ARG */ return posix_error(); - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } #endif /* HAVE_SETPGRP */ @@ -6585,8 +6582,7 @@ os_setreuid_impl(PyObject *module, uid_t ruid, uid_t euid) if (setreuid(ruid, euid) < 0) { return posix_error(); } else { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } } #endif /* HAVE_SETREUID */ @@ -6681,8 +6677,7 @@ os_setgroups(PyObject *module, PyObject *groups) if (setgroups(len, grouplist) < 0) return posix_error(); - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } #endif /* HAVE_SETGROUPS */ -- cgit v1.2.1