From: Andrew Bartlett Date: Mon, 29 Feb 2016 20:27:11 +0000 (+1300) Subject: pycredentials: Use pytalloc_BaseObject_PyType_Ready() X-Git-Tag: talloc-2.1.6~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc747539dc1219135face7d6f77c7174a9c978cd;p=thirdparty%2Fsamba.git pycredentials: Use pytalloc_BaseObject_PyType_Ready() This changes pycredentials to use talloc.BaseObject() just like the PIDL output Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam --- diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c index 77671d0b416..13443910ad7 100644 --- a/auth/credentials/pycredentials.c +++ b/auth/credentials/pycredentials.c @@ -459,7 +459,6 @@ static PyMethodDef py_creds_methods[] = { PyTypeObject PyCredentials = { .tp_name = "credentials.Credentials", - .tp_basicsize = sizeof(pytalloc_Object), .tp_new = py_creds_new, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_methods = py_creds_methods, @@ -468,23 +467,16 @@ PyTypeObject PyCredentials = { PyTypeObject PyCredentialCacheContainer = { .tp_name = "credentials.CredentialCacheContainer", - .tp_basicsize = sizeof(pytalloc_Object), .tp_flags = Py_TPFLAGS_DEFAULT, }; void initcredentials(void) { PyObject *m; - PyTypeObject *talloc_type = pytalloc_GetObjectType(); - if (talloc_type == NULL) + if (pytalloc_BaseObject_PyType_Ready(&PyCredentials) < 0) return; - PyCredentials.tp_base = PyCredentialCacheContainer.tp_base = talloc_type; - - if (PyType_Ready(&PyCredentials) < 0) - return; - - if (PyType_Ready(&PyCredentialCacheContainer) < 0) + if (pytalloc_BaseObject_PyType_Ready(&PyCredentialCacheContainer) < 0) return; m = Py_InitModule3("credentials", NULL, "Credentials management.");