summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-03-03 22:29:07 +0100
committerAndrew Bartlett <abartlet@samba.org>2015-03-03 23:20:06 +0100
commit92ff259f409cfeffc24ef9d7db8ab16217367bab (patch)
treee05cf61d8d27e99d4c144a40115e3113009b8394 /lib
parent39b08c7c1ee2173e47c8e9d381b89c4d74a5e0f5 (diff)
downloadsamba-92ff259f409cfeffc24ef9d7db8ab16217367bab.tar.gz
samba-92ff259f409cfeffc24ef9d7db8ab16217367bab.tar.xz
samba-92ff259f409cfeffc24ef9d7db8ab16217367bab.zip
pyldb: Use the Py_TYPE macro
The "ob_type" member of Python objects is going away in Python 3 for compliance with C's strict aliasing rules. The Py_TYPE macro should be used instead. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ldb/pyldb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index 9bbd4ba66b..4f452fa5e7 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -88,7 +88,7 @@ static void py_ldb_control_dealloc(PyLdbControlObject *self)
talloc_free(self->mem_ctx);
}
self->data = NULL;
- self->ob_type->tp_free(self);
+ Py_TYPE(self)->tp_free(self);
}
static PyObject *py_ldb_control_get_oid(PyLdbControlObject *self)
@@ -1993,7 +1993,7 @@ static PyObject *PyLdb_FromLdbContext(struct ldb_context *ldb_ctx)
static void py_ldb_dealloc(PyLdbObject *self)
{
talloc_free(self->mem_ctx);
- self->ob_type->tp_free(self);
+ Py_TYPE(self)->tp_free(self);
}
static PyTypeObject PyLdb = {
@@ -2017,7 +2017,7 @@ static void py_ldb_result_dealloc(PyLdbResultObject *self)
Py_DECREF(self->msgs);
Py_DECREF(self->referals);
Py_DECREF(self->controls);
- self->ob_type->tp_free(self);
+ Py_TYPE(self)->tp_free(self);
}
static PyObject *py_ldb_result_get_msgs(PyLdbResultObject *self, void *closure)