Message ID | 20231009190729.38675-1-brgl@bgdev.pl |
---|---|
State | New |
Headers | show |
Series | [libgpiod] bindings: python: replace PyModule_AddObjectRef() with PyModule_AddObjectRef() | expand |
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; }