Linux-GPIO Archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
To: Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Vincent Fazio <vfazio@xes-inc.com>
Cc: linux-gpio@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Subject: [libgpiod][PATCH] Revert "bindings: python: replace PyModule_AddObjectRef() with PyModule_AddObject()"
Date: Mon, 30 Mar 2026 14:50:23 +0200	[thread overview]
Message-ID: <20260330125023.109789-1-bartosz.golaszewski@oss.qualcomm.com> (raw)

This reverts commit b436d05809b17ed734d08a36a8913eb687506433.

Commit 950ff3d1b300 ("bindings: python: drop python 3.9 support")
removed support for python v3.9 and with v3.10 now being the minimum
required version, we're now free to use PyModule_AddObjectRef().

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 bindings/python/gpiod/ext/module.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bindings/python/gpiod/ext/module.c b/bindings/python/gpiod/ext/module.c
index b456190..25c252a 100644
--- a/bindings/python/gpiod/ext/module.c
+++ b/bindings/python/gpiod/ext/module.c
@@ -178,9 +178,9 @@ PyMODINIT_FUNC PyInit__ext(void)
 		return NULL;
 	}
 
-	ret = PyModule_AddObject(module, "__all__", all);
+	ret = PyModule_AddObjectRef(module, "__all__", all);
+	Py_DECREF(all);
 	if (ret) {
-		Py_DECREF(all);
 		Py_DECREF(module);
 		return NULL;
 	}
-- 
2.47.3


             reply	other threads:[~2026-03-30 12:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 12:50 Bartosz Golaszewski [this message]
2026-03-30 13:34 ` [libgpiod][PATCH] Revert "bindings: python: replace PyModule_AddObjectRef() with PyModule_AddObject()" Vincent Fazio
2026-03-31 13:04 ` Bartosz Golaszewski

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=20260330125023.109789-1-bartosz.golaszewski@oss.qualcomm.com \
    --to=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=vfazio@xes-inc.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).