From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Phil Howard <phil@gadgetoid.com>
Cc: Kent Gibson <warthog618@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Erik Schilling <erik.schilling@linaro.org>,
linux-gpio@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [libgpiod][PATCH] bindings: python: replace PyModule_AddObjectRef() with PyModule_AddObjectRef()
Date: Tue, 10 Oct 2023 08:31:09 +0200 [thread overview]
Message-ID: <CAMRc=Mdg2rasefCZAx+13pJh6boyKP6oWNBm6d1G_qn6VS=-gw@mail.gmail.com> (raw)
In-Reply-To: <CA+kSVo-pkmque7Zig3a7iwRN=4OtHmi0dpyO5Zc9ttOabYd8XA@mail.gmail.com>
On Mon, Oct 9, 2023 at 11:00 PM Phil Howard <phil@gadgetoid.com> wrote:
>
> On Mon, 9 Oct 2023 at 20:07, Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > PyModule_AddObjectRef() was added in cpython v3.10 while libgpiod claims
> > to depend on python v3.9. Replace it with an older variant that steals the
> > reference to the added object on success.
>
> Ah, fixing this makes much more sense than bumping the dependent
> version, thank you, I will update my patch.
>
And of course the commit message was supposed to read: "bindings:
python: replace PyModule_AddObjectRef() with PyModule_AddObject()".
I'll fix it when applying.
Bart
> >
> > Reported-by: Phil Howard <phil@gadgetoid.com>
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > ---
> > 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 25c252a..b456190 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_AddObjectRef(module, "__all__", all);
> > - Py_DECREF(all);
> > + ret = PyModule_AddObject(module, "__all__", all);
> > if (ret) {
> > + Py_DECREF(all);
> > Py_DECREF(module);
> > return NULL;
> > }
> > --
> > 2.39.2
> >
next prev parent reply other threads:[~2023-10-10 6:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 19:07 [libgpiod][PATCH] bindings: python: replace PyModule_AddObjectRef() with PyModule_AddObjectRef() Bartosz Golaszewski
2023-10-09 20:59 ` Phil Howard
2023-10-10 6:31 ` Bartosz Golaszewski [this message]
2023-10-10 9:50 ` Phil Howard
2023-10-10 10:01 ` 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='CAMRc=Mdg2rasefCZAx+13pJh6boyKP6oWNBm6d1G_qn6VS=-gw@mail.gmail.com' \
--to=brgl@bgdev.pl \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=erik.schilling@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=phil@gadgetoid.com \
--cc=viresh.kumar@linaro.org \
--cc=warthog618@gmail.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 NNTP newsgroup(s).