1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

pycredentials: Use pytalloc_BaseObject_PyType_Ready()

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>
This commit is contained in:
Andrew Bartlett 2016-03-01 09:27:11 +13:00
parent d850991ee2
commit fc747539dc

View File

@ -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.");