Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Duskett <aduskett@gmail.com>
To: buildroot@buildroot.org
Cc: Jugurtha BELKALEM <jugurtha.belkalem@smile.fr>,
	Samuel Martin <s.martin49@gmail.com>,
	Asaf Kahlon <asafka7@gmail.com>, Julien Olivain <ju.o@free.fr>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Oli Vogt <oli.vogt.pub01@gmail.com>,
	Adam Duskett <aduskett@gmail.com>
Subject: [Buildroot] [PATCH v2 08/11] package/python-pyalsa: add 0001-fix-pytuple-set-item-usage-no-return-value.patch
Date: Thu, 14 Oct 2021 15:58:46 -0700	[thread overview]
Message-ID: <20211014225849.832479-9-aduskett@gmail.com> (raw)
In-Reply-To: <20211014225849.832479-1-aduskett@gmail.com>

This patch is a backport of commit 5ea2f8709b4d091700750661231f8a3ddce0fc7c and
fixes compatibility with python 3.10.

Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
 ...tuple-set-item-usage-no-return-value.patch | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 package/python-pyalsa/0001-fix-pytuple-set-item-usage-no-return-value.patch

diff --git a/package/python-pyalsa/0001-fix-pytuple-set-item-usage-no-return-value.patch b/package/python-pyalsa/0001-fix-pytuple-set-item-usage-no-return-value.patch
new file mode 100644
index 0000000000..d3db1ed2e0
--- /dev/null
+++ b/package/python-pyalsa/0001-fix-pytuple-set-item-usage-no-return-value.patch
@@ -0,0 +1,48 @@
+From 5ea2f8709b4d091700750661231f8a3ddce0fc7c Mon Sep 17 00:00:00 2001
+From: Jaroslav Kysela <perex@perex.cz>
+Date: Thu, 10 Dec 2020 16:00:50 +0100
+Subject: [PATCH] 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: https://github.com/alsa-project/alsa-python/issues/2
+From upstream-commit: 5ea2f8709b4d091700750661231f8a3ddce0fc7c
+Signed-off-by: Jaroslav Kysela <perex@perex.cz>
+Signed-off-by: Adam Duskett <aduskett@gmail.com>
+---
+ pyalsa/alsahcontrol.c | 4 ++--
+ pyalsa/alsamixer.c    | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/pyalsa/alsahcontrol.c b/pyalsa/alsahcontrol.c
+index ebee1b7..7c9321f 100644
+--- a/pyalsa/alsahcontrol.c
++++ b/pyalsa/alsahcontrol.c
+@@ -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);
+diff --git a/pyalsa/alsamixer.c b/pyalsa/alsamixer.c
+index 39d7387..91fe198 100644
+--- a/pyalsa/alsamixer.c
++++ b/pyalsa/alsamixer.c
+@@ -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);
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2021-10-14 23:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 22:58 [Buildroot] [PATCH v2 00/11] package/python3: bump to version 3.10 Adam Duskett
2021-10-14 22:58 ` [Buildroot] [PATCH v2 01/11] package/util-linux: bump to version 2.37.2 Adam Duskett
2021-10-16 16:51   ` Yann E. MORIN
2021-10-14 22:58 ` [Buildroot] [PATCH v2 02/11] package/python-pydantic: bump to version 1.8.2 Adam Duskett
2021-10-25 19:13   ` Arnout Vandecappelle
2021-10-14 22:58 ` [Buildroot] [PATCH v2 03/11] package/python-txtorcon: bump to version 21.1.0 Adam Duskett
2021-10-25 19:21   ` Arnout Vandecappelle
2021-10-14 22:58 ` [Buildroot] [PATCH v2 04/11] package/python-watchdog: bump to version 2.1.6 Adam Duskett
2021-10-25 19:14   ` Arnout Vandecappelle
2021-10-14 22:58 ` [Buildroot] [PATCH v2 05/11] package/python-certifi: add host variant Adam Duskett
2021-10-25 19:21   ` Arnout Vandecappelle
2021-10-14 22:58 ` [Buildroot] [PATCH v2 06/11] package/python-matplotlib: bump to version 3.4.3 Adam Duskett
2021-10-25 19:22   ` Arnout Vandecappelle
2021-10-14 22:58 ` [Buildroot] [PATCH v2 07/11] package/python-numpy: bump to version 1.21.2 Adam Duskett
2021-12-29 23:07   ` Thomas Petazzoni
2021-10-14 22:58 ` Adam Duskett [this message]
2021-12-29 23:13   ` [Buildroot] [PATCH v2 08/11] package/python-pyalsa: add 0001-fix-pytuple-set-item-usage-no-return-value.patch Thomas Petazzoni
2021-10-14 22:58 ` [Buildroot] [PATCH v2 09/11] package/python-django-enumfields: bump to version Adam Duskett
2021-12-29 23:14   ` Thomas Petazzoni
2021-10-14 22:58 ` [Buildroot] [PATCH v2 10/11] package/python-setuptools: bump to version 58.2.0 and split python2 version Adam Duskett
2021-10-25 19:22   ` Arnout Vandecappelle
2021-10-14 22:58 ` [Buildroot] [PATCH v2 11/11] package/python3: bump to version 3.10 Adam Duskett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211014225849.832479-9-aduskett@gmail.com \
    --to=aduskett@gmail.com \
    --cc=asafka7@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=ju.o@free.fr \
    --cc=jugurtha.belkalem@smile.fr \
    --cc=oli.vogt.pub01@gmail.com \
    --cc=s.martin49@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox