This changes pycredentials 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>
PyTypeObject PyCredentials = {
.tp_name = "credentials.Credentials",
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,
.tp_new = py_creds_new,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_methods = py_creds_methods,
PyTypeObject PyCredentialCacheContainer = {
.tp_name = "credentials.CredentialCacheContainer",
PyTypeObject PyCredentialCacheContainer = {
.tp_name = "credentials.CredentialCacheContainer",
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_flags = Py_TPFLAGS_DEFAULT,
};
void initcredentials(void)
{
PyObject *m;
.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)
- 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.");
return;
m = Py_InitModule3("credentials", NULL, "Credentials management.");