sssd/0090-UTIL-Remove-python-wrapper-sss_python_set_check.patch

80 lines
2.6 KiB
Diff

From 2d282d0aab99219337d27ee520825539405c65a6 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@redhat.com>
Date: Mon, 9 Feb 2015 19:30:39 +0100
Subject: [PATCH 90/99] UTIL: Remove python wrapper sss_python_set_check
The macro PySet_Check is defined in python >= 2.6
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
---
src/external/python.m4 | 2 +-
src/python/pyhbac.c | 2 +-
src/util/sss_python.c | 10 ----------
src/util/sss_python.h | 3 ---
4 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/src/external/python.m4 b/src/external/python.m4
index e3812a50406e7f6e2b2f143f3022ee07431ac120..e93f850092b0f54565e138b3235b9c29f89e5444 100644
--- a/src/external/python.m4
+++ b/src/external/python.m4
@@ -63,7 +63,7 @@ AC_DEFUN([AM_CHECK_PYTHON_COMPAT],
LIBS="$LIBS $PYTHON_LIBS"
AC_CHECK_FUNCS([PyErr_NewExceptionWithDoc])
- AC_CHECK_DECLS([PySet_Check, PyModule_AddIntMacro, PyUnicode_FromString], [], [], [[#include <Python.h>]])
+ AC_CHECK_DECLS([PyModule_AddIntMacro, PyUnicode_FromString], [], [], [[#include <Python.h>]])
CPPFLAGS="$save_CPPFLAGS"
LIBS="$save_LIBS"
diff --git a/src/python/pyhbac.c b/src/python/pyhbac.c
index 11cd40656bbeaf93c2b1717483e716ba45a78a69..bbdf2b9fb75e2be0d46749faa6aaf0698a5d5ebb 100644
--- a/src/python/pyhbac.c
+++ b/src/python/pyhbac.c
@@ -452,7 +452,7 @@ hbac_rule_element_set_category(HbacRuleElement *self,
CHECK_ATTRIBUTE_DELETE(category, "category");
- if (!sss_python_set_check(category)) {
+ if (!PySet_Check(category)) {
PyErr_Format(PyExc_TypeError, "The category must be a set type\n");
return -1;
}
diff --git a/src/util/sss_python.c b/src/util/sss_python.c
index 56850782a64314db70286ef67d76ae1227d8625f..ba78bf9689c903713229395a49e5f3686e5e6f10 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"
-bool
-sss_python_set_check(PyObject *set)
-{
-#if HAVE_DECL_PYSET_CHECK
- return PySet_Check(set);
-#else
- return PyObject_TypeCheck(set, &PySet_Type);
-#endif
-}
-
PyObject *
sss_python_unicode_from_string(const char *u)
{
diff --git a/src/util/sss_python.h b/src/util/sss_python.h
index 1ff13c4ef4380ff791cf3cfbe12845fb26b3b873..56c25ebb74bffc061688c3c32515d6e0288ac94d 100644
--- a/src/util/sss_python.h
+++ b/src/util/sss_python.h
@@ -25,9 +25,6 @@
#define PYNUMBER_ASLONG(what) PyInt_AsLong(what)
#endif
-/* Wrappers providing the subset of C API for python's set objects we use */
-bool sss_python_set_check(PyObject *set);
-
/* Unicode compatibility */
PyObject *sss_python_unicode_from_string(const char *u);
--
2.4.0