]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pyauth: Use pytalloc_BaseObject_PyType_Ready()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 29 Feb 2016 20:32:56 +0000 (09:32 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 8 Mar 2016 00:58:29 +0000 (01:58 +0100)
This changes pyauth to use talloc.BaseObject() just like the PIDL output

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
source4/auth/pyauth.c

index 37f19fa2421d59232b68f155a9ec7578a8642118..61db907b90260917f05a26e91ad350d92134f2ed 100644 (file)
@@ -292,7 +292,6 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
 
 static PyTypeObject PyAuthContext = {
        .tp_name = "AuthContext",
-       .tp_basicsize = sizeof(pytalloc_Object),
        .tp_flags = Py_TPFLAGS_DEFAULT,
        .tp_new = py_auth_context_new,
 };
@@ -308,11 +307,7 @@ void initauth(void)
 {
        PyObject *m;
 
-       PyAuthContext.tp_base = pytalloc_GetObjectType();
-       if (PyAuthContext.tp_base == NULL)
-               return;
-
-       if (PyType_Ready(&PyAuthContext) < 0)
+       if (pytalloc_BaseObject_PyType_Ready(&PyAuthContext) < 0)
                return;
 
        m = Py_InitModule3("auth", py_auth_methods,