From 92ff259f409cfeffc24ef9d7db8ab16217367bab Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 3 Mar 2015 22:29:07 +0100 Subject: 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 Reviewed-by: Jelmer Vernooij Reviewed-by: Andrew Bartlett --- lib/ldb/pyldb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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) -- cgit