pytalloc: Remove deprecated pytalloc_CObject_FromTallocPtr()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 4 Mar 2019 09:11:05 +0000 (22:11 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 21 Mar 2019 04:06:14 +0000 (04:06 +0000)
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 <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/talloc/pytalloc.h
lib/talloc/pytalloc_util.c

index 11653bf64cff894b007e6f7f6c8ce0f6e1dcd2e4..37416fcb46fdb65d3d215b0ab2197e7656d9bfba 100644 (file)
@@ -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.
index 923fe5d634fd0c5f30c574fc06e3dc8788394ea7..265bdcd7e8feeb531a04ed18a9b2738e1f5234ee 100644 (file)
@@ -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.