From: Andrew Bartlett Date: Mon, 4 Mar 2019 09:11:05 +0000 (+1300) Subject: pytalloc: Remove deprecated pytalloc_CObject_FromTallocPtr() X-Git-Tag: talloc-2.2.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa980eb654a28a652cec64b2374858645e1bf533;p=thirdparty%2Fsamba.git pytalloc: Remove deprecated pytalloc_CObject_FromTallocPtr() This function makes it harder to remove the --extra-python handlers and is only provided for Python 2.x, support for which Samba is removing. Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/lib/talloc/pytalloc.h b/lib/talloc/pytalloc.h index 11653bf64cf..37416fcb46f 100644 --- a/lib/talloc/pytalloc.h +++ b/lib/talloc/pytalloc.h @@ -61,21 +61,6 @@ PyObject *pytalloc_reference_ex(PyTypeObject *py_type, TALLOC_CTX *mem_ctx, void #define pytalloc_new(type, typeobj) pytalloc_steal(typeobj, talloc_zero(NULL, type)) -#if PY_MAJOR_VERSION < 3 -/* - * Don't use this anymore! Use pytalloc_GenericObject_steal() - * or pytalloc_GenericObject_reference(). - */ -#ifndef _DEPRECATED_ -#ifdef HAVE___ATTRIBUTE__ -#define _DEPRECATED_ __attribute__ ((deprecated)) -#else -#define _DEPRECATED_ -#endif -#endif -PyObject *pytalloc_CObject_FromTallocPtr(void *) _DEPRECATED_; -#endif - /* * Wrap a generic talloc pointer into a talloc.GenericObject, * this is a subclass of talloc.BaseObject. diff --git a/lib/talloc/pytalloc_util.c b/lib/talloc/pytalloc_util.c index 923fe5d634f..265bdcd7e8f 100644 --- a/lib/talloc/pytalloc_util.c +++ b/lib/talloc/pytalloc_util.c @@ -207,23 +207,6 @@ _PUBLIC_ PyObject *pytalloc_reference_ex(PyTypeObject *py_type, } } -#if PY_MAJOR_VERSION < 3 - -static void py_cobject_talloc_free(void *ptr) -{ - talloc_free(ptr); -} - -_PUBLIC_ PyObject *pytalloc_CObject_FromTallocPtr(void *ptr) -{ - if (ptr == NULL) { - Py_RETURN_NONE; - } - return PyCObject_FromVoidPtr(ptr, py_cobject_talloc_free); -} - -#endif - /* * Wrap a generic talloc pointer into a talloc.GenericObject, * this is a subclass of talloc.BaseObject.