diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2015-02-09 19:19:55 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-02-25 08:38:20 +0100 |
commit | 9eabaad5e0f3f20a6bcec0629342584c244a79bc (patch) | |
tree | 64452cb16adc499902cabd2ceb7b3ae3d885096d | |
parent | d6c3de740c7bed8b007805d6a313220d8d974ee5 (diff) | |
download | sssd-9eabaad5e0f3f20a6bcec0629342584c244a79bc.tar.gz sssd-9eabaad5e0f3f20a6bcec0629342584c244a79bc.tar.xz sssd-9eabaad5e0f3f20a6bcec0629342584c244a79bc.zip |
UTIL: Remove python wrapper sss_python_set_new
The function PySet_New is available in python >= 2.6
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
-rw-r--r-- | src/external/python.m4 | 2 | ||||
-rw-r--r-- | src/python/pyhbac.c | 4 | ||||
-rw-r--r-- | src/util/sss_python.c | 10 | ||||
-rw-r--r-- | src/util/sss_python.h | 1 |
4 files changed, 3 insertions, 14 deletions
diff --git a/src/external/python.m4 b/src/external/python.m4 index 858af3c19..440d2f977 100644 --- a/src/external/python.m4 +++ b/src/external/python.m4 @@ -62,7 +62,7 @@ AC_DEFUN([AM_CHECK_PYTHON_COMPAT], CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" LIBS="$LIBS $PYTHON_LIBS" - AC_CHECK_FUNCS([PySet_New PySet_Add PyErr_NewExceptionWithDoc]) + AC_CHECK_FUNCS([PySet_Add PyErr_NewExceptionWithDoc]) AC_CHECK_DECLS([PySet_Check, PyModule_AddIntMacro, PyUnicode_FromString], [], [], [[#include <Python.h>]]) CPPFLAGS="$save_CPPFLAGS" diff --git a/src/python/pyhbac.c b/src/python/pyhbac.c index f3aaa60f0..3385cc441 100644 --- a/src/python/pyhbac.c +++ b/src/python/pyhbac.c @@ -303,7 +303,7 @@ HbacRuleElement_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return NULL; } - self->category = sss_python_set_new(); + self->category = PySet_New(NULL); self->names = PyList_New(0); self->groups = PyList_New(0); if (!self->names || !self->groups || !self->category) { @@ -945,7 +945,7 @@ py_hbac_rule_validate(HbacRuleObject *self, PyObject *args) } py_is_valid = PyBool_FromLong(is_valid); - py_missing = sss_python_set_new(); + py_missing = PySet_New(NULL); if (!py_missing || !py_is_valid) { PyErr_NoMemory(); goto fail; diff --git a/src/util/sss_python.c b/src/util/sss_python.c index 19717a55c..dad2a46d8 100644 --- a/src/util/sss_python.c +++ b/src/util/sss_python.c @@ -21,16 +21,6 @@ #include "src/util/sss_python.h" #include "config.h" -PyObject * -sss_python_set_new(void) -{ -#ifdef HAVE_PYSET_NEW - return PySet_New(NULL); -#else - return PyObject_CallObject((PyObject *) &PySet_Type, NULL); -#endif -} - int sss_python_set_add(PyObject *set, PyObject *key) { diff --git a/src/util/sss_python.h b/src/util/sss_python.h index cf8c84848..6851a64e8 100644 --- a/src/util/sss_python.h +++ b/src/util/sss_python.h @@ -26,7 +26,6 @@ #endif /* Wrappers providing the subset of C API for python's set objects we use */ -PyObject *sss_python_set_new(void); int sss_python_set_add(PyObject *set, PyObject *key); bool sss_python_set_check(PyObject *set); |