Skip to content

Commit 5ea2f87

Browse files
committed
Fix PyTuple_SET_ITEM() usage - no return value
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: #2 Signed-off-by: Jaroslav Kysela <[email protected]>
1 parent a64a6cc commit 5ea2f87

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pyalsa/alsahcontrol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,8 +1543,8 @@ static int element_callback(snd_hctl_elem_t *elem, unsigned int mask)
15431543

15441544
t = PyTuple_New(2);
15451545
if (t) {
1546-
if (PyTuple_SET_ITEM(t, 0, (PyObject *)pyhelem))
1547-
Py_INCREF(pyhelem);
1546+
PyTuple_SET_ITEM(t, 0, (PyObject *)pyhelem);
1547+
Py_INCREF(pyhelem);
15481548
PyTuple_SET_ITEM(t, 1, PyInt_FromLong(mask));
15491549
r = PyObject_CallObject(o, t);
15501550
Py_DECREF(t);

pyalsa/alsamixer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,8 +1348,8 @@ static int element_callback(snd_mixer_elem_t *elem, unsigned int mask)
13481348

13491349
t = PyTuple_New(2);
13501350
if (t) {
1351-
if (PyTuple_SET_ITEM(t, 0, (PyObject *)pyelem))
1352-
Py_INCREF(pyelem);
1351+
PyTuple_SET_ITEM(t, 0, (PyObject *)pyelem);
1352+
Py_INCREF(pyelem);
13531353
PyTuple_SET_ITEM(t, 1, PyInt_FromLong(mask));
13541354
r = PyObject_CallObject(o, t);
13551355
Py_DECREF(t);

0 commit comments

Comments
 (0)