summaryrefslogtreecommitdiff
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-23 09:47:21 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-23 09:47:21 +0200
commit228b12edcce49649d6befa3c03dbcefd5a22ae76 (patch)
tree1066be6909fb981fcf30e1a8e224d43567bd9b92 /Modules/posixmodule.c
parent60e6e962bac6a668d0df539ebf526a0a1c69eacd (diff)
downloadcpython-git-228b12edcce49649d6befa3c03dbcefd5a22ae76.tar.gz
Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c15
1 files changed, 5 insertions, 10 deletions
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 */