summaryrefslogtreecommitdiffstats
path: root/Modules/termios.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-23 07:47:21 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-23 07:47:21 (GMT)
commit228b12edcce49649d6befa3c03dbcefd5a22ae76 (patch)
tree1066be6909fb981fcf30e1a8e224d43567bd9b92 /Modules/termios.c
parent60e6e962bac6a668d0df539ebf526a0a1c69eacd (diff)
downloadcpython-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/termios.c')
-rw-r--r--Modules/termios.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/Modules/termios.c b/Modules/termios.c
index b78d33e..6ed4395 100644
--- a/Modules/termios.c
+++ b/Modules/termios.c
@@ -194,8 +194,7 @@ termios_tcsetattr(PyObject *self, PyObject *args)
if (tcsetattr(fd, when, &mode) == -1)
return PyErr_SetFromErrno(TermiosError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(termios_tcsendbreak__doc__,
@@ -216,8 +215,7 @@ termios_tcsendbreak(PyObject *self, PyObject *args)
if (tcsendbreak(fd, duration) == -1)
return PyErr_SetFromErrno(TermiosError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(termios_tcdrain__doc__,
@@ -236,8 +234,7 @@ termios_tcdrain(PyObject *self, PyObject *args)
if (tcdrain(fd) == -1)
return PyErr_SetFromErrno(TermiosError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(termios_tcflush__doc__,
@@ -259,8 +256,7 @@ termios_tcflush(PyObject *self, PyObject *args)
if (tcflush(fd, queue) == -1)
return PyErr_SetFromErrno(TermiosError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(termios_tcflow__doc__,
@@ -282,8 +278,7 @@ termios_tcflow(PyObject *self, PyObject *args)
if (tcflow(fd, action) == -1)
return PyErr_SetFromErrno(TermiosError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyMethodDef termios_methods[] =