]> git.alsa-project.org Git - alsa-python.git/commitdiff
Fix PyTuple_SET_ITEM() usage - no return value
authorJaroslav Kysela <perex@perex.cz>
Thu, 10 Dec 2020 15:00:50 +0000 (16:00 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 10 Dec 2020 15:03:33 +0000 (16:03 +0100)
As noted in bpo-30459 (link bellow) the PyTuple_SET_ITEM() macro
has not a return value. Let's make code compatible with python 3.10.

Link: https://bugs.python.org/issue30459
BugLink: https://github.com/alsa-project/alsa-python/issues/2
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
pyalsa/alsahcontrol.c
pyalsa/alsamixer.c

index ebee1b7c094aaaea06a85b5b82a7a3fff8b862de..7c9321f811a02e061a373ce7f473ea325cc0a39d 100644 (file)
@@ -1543,8 +1543,8 @@ static int element_callback(snd_hctl_elem_t *elem, unsigned int mask)
 
        t = PyTuple_New(2);
        if (t) {
-               if (PyTuple_SET_ITEM(t, 0, (PyObject *)pyhelem))
-                       Py_INCREF(pyhelem);
+               PyTuple_SET_ITEM(t, 0, (PyObject *)pyhelem);
+               Py_INCREF(pyhelem);
                PyTuple_SET_ITEM(t, 1, PyInt_FromLong(mask));
                r = PyObject_CallObject(o, t);
                Py_DECREF(t);
index 39d7387500c4e54b68646044267f7f8547deb2c0..91fe198c7b3797359b12308fb089fc21346fd463 100644 (file)
@@ -1348,8 +1348,8 @@ static int element_callback(snd_mixer_elem_t *elem, unsigned int mask)
 
        t = PyTuple_New(2);
        if (t) {
-               if (PyTuple_SET_ITEM(t, 0, (PyObject *)pyelem))
-                       Py_INCREF(pyelem);
+               PyTuple_SET_ITEM(t, 0, (PyObject *)pyelem);
+               Py_INCREF(pyelem);
                PyTuple_SET_ITEM(t, 1, PyInt_FromLong(mask));
                r = PyObject_CallObject(o, t);
                Py_DECREF(t);