From: Samuel Cabrero Date: Tue, 24 May 2022 10:44:36 +0000 (+0200) Subject: pygpo: Make ads_ADSType object inherit from pytalloc_BaseObject X-Git-Tag: tevent-0.13.0~301 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=577fdd0f97a6ae8e983d6b2eefe5cfc37d961161;p=thirdparty%2Fsamba.git pygpo: Make ads_ADSType object inherit from pytalloc_BaseObject Prepare to allocate ADS_STRUCT under a talloc context. Signed-off-by: Samuel Cabrero Reviewed-by: Jeremy Allison --- diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c index b5ec85a48d4..221900e62fe 100644 --- a/libgpo/pygpo.c +++ b/libgpo/pygpo.c @@ -29,6 +29,7 @@ #include "libcli/util/pyerrors.h" #include "python/py3compat.h" #include "python/modules.h" +#include /* A Python C API module to use LIBGPO */ @@ -498,6 +499,7 @@ static PyMethodDef ADS_methods[] = { static PyTypeObject ads_ADSType = { .tp_name = "gpo.ADS_STRUCT", .tp_basicsize = sizeof(ADS), + .tp_new = PyType_GenericNew, .tp_dealloc = (destructor)py_ads_dealloc, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = "ADS struct", @@ -540,8 +542,7 @@ MODULE_INIT_FUNC(gpo) goto err; } - ads_ADSType.tp_new = PyType_GenericNew; - if (PyType_Ready(&ads_ADSType) < 0) { + if (pytalloc_BaseObject_PyType_Ready(&ads_ADSType) < 0) { goto err; }