Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c
index 5f0505c..1cdbbae 100644
--- a/Modules/ossaudiodev.c
+++ b/Modules/ossaudiodev.c
@@ -307,8 +307,7 @@
if (rv == -1)
return PyErr_SetFromErrno(PyExc_IOError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -326,8 +325,7 @@
mode once we're in non-blocking mode! */
if (ioctl(self->fd, SNDCTL_DSP_NONBLOCK, NULL) == -1)
return PyErr_SetFromErrno(PyExc_IOError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -514,8 +512,7 @@
cp += rv;
}
PyBuffer_Release(&data);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -527,8 +524,7 @@
Py_END_ALLOW_THREADS
self->fd = -1;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -747,8 +743,7 @@
close(self->fd);
self->fd = -1;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *