Revert "bindings: python: replace PyModule_AddObjectRef() with PyModule_AddObject()"
PATCH 1/1 Revert "bindings: python: replace PyModule_AddObjectRef() with PyModule_AddObject()"
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().
--- bindings/python/gpiod/ext/module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
bindings/python/gpiod/ext/module.c +2 -2
@@ -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 ; }
Signature · 1 line
2.47.3
Quoted 11 lines
-----Original Message-----
From: Bartosz Golaszewski <[email protected]>
Sent: Monday, March 30, 2026 7:50 AM
To: Linus Walleij <[email protected]>; Bartosz Golaszewski <[email protected]>; Vincent Fazio <[email protected]>
Cc: [email protected]; Bartosz Golaszewski <[email protected]>
Subject: [libgpiod][PATCH] Revert "bindings: python: replacePyModule_AddObjectRef()withPyModule_AddObject()"
Quoted 8 lines
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 usePyModule_AddObjectRef().Signed-off-by: Bartosz Golaszewski
<[email protected]>
Bartosz Golaszewski
AppliedQuoted 8 lines · Bartosz Golaszewski
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 usePyModule_AddObjectRef().[...]
Applied, thanks!
[1/1] Revert "bindings: python: replace PyModule_AddObjectRef() with PyModule_AddObject()"
https://git.kernel.org/brgl/c/2e47ad76bc66c2abfb02e4b9d3982fa246af07e0
Best regards,
Signature · 1 line
Bartosz Golaszewski <[email protected]>