From dd673b5124b725d4ec531c482d312f7f7fd0b01a Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Fri, 7 Feb 2014 07:52:46 -0500 Subject: python: fix build problems with Cython 0.20 Resolve the following build problem with Cython 0.20; I've also tested this change on Cython 0.19.2 without problem. >>> Error compiling Cython file: ------------------------------------------------------------ ... Helper function which should only be used internally by SyscallFilter objects and exists for the sole purpose of making it easier to deal with the varadic functions of the libseccomp API, e.g. seccomp_rule_add(). """ return self._arg ^ ------------------------------------------------------------ seccomp.pyx:194:19: Cannot convert 'scmp_arg_cmp' to Python object >>> Signed-off-by: Paul Moore --- src/python/seccomp.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/python') diff --git a/src/python/seccomp.pyx b/src/python/seccomp.pyx index 01ea0a9..4082bad 100644 --- a/src/python/seccomp.pyx +++ b/src/python/seccomp.pyx @@ -182,7 +182,7 @@ cdef class Arg: self._arg.datum_a = datum_a self._arg.datum_b = datum_b - def to_c(self): + cdef libseccomp.scmp_arg_cmp to_c(self): """ Convert the object into a C structure. Description: @@ -425,6 +425,7 @@ cdef class SyscallFilter: """ NOTE: the code below exists solely to deal with the varadic nature of seccomp_rule_add() function and the inability of Cython to handle this automatically """ + cdef Arg arg for i, arg in enumerate(args): c_arg[i] = arg.to_c() if len(args) == 0: @@ -504,6 +505,7 @@ cdef class SyscallFilter: """ NOTE: the code below exists solely to deal with the varadic nature of seccomp_rule_add_exact() function and the inability of Cython to handle this automatically """ + cdef Arg arg for i, arg in enumerate(args): c_arg[i] = arg.to_c() if len(args) == 0: -- cgit v1.2.1