summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2013-10-08 15:36:13 -0400
committerPaul Moore <pmoore@redhat.com>2013-10-08 15:36:13 -0400
commit4021195b83f6d7fd50c382928cb522feadaea842 (patch)
tree9179c181181d7e74f268393711da98c589019b21
parentcb528e0ed26eb6cf1f308e5f4db784b96610b562 (diff)
downloadlibseccomp-4021195b83f6d7fd50c382928cb522feadaea842.tar.gz
python: Add a docstring for the SyscallFilter constructor
Cython doesn't support docstrings for __cinit__. This change will (very slightly) slow down construction, but it makes ipython happer. Signed-off-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Paul Moore <pmoore@redhat.com>
-rw-r--r--src/python/seccomp.pyx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/python/seccomp.pyx b/src/python/seccomp.pyx
index 4d58a80..ed7c1bb 100644
--- a/src/python/seccomp.pyx
+++ b/src/python/seccomp.pyx
@@ -191,6 +191,12 @@ cdef class SyscallFilter:
cdef libseccomp.scmp_filter_ctx _ctx
def __cinit__(self, int defaction):
+ self._ctx = libseccomp.seccomp_init(defaction)
+ if self._ctx == NULL:
+ raise RuntimeError("Library error")
+ _defaction = defaction
+
+ def __init__(self, defaction):
""" Initialize the filter state
Arguments:
@@ -199,10 +205,6 @@ cdef class SyscallFilter:
Description:
Initializes the seccomp filter state to the defaults.
"""
- self._ctx = libseccomp.seccomp_init(defaction)
- if self._ctx == NULL:
- raise RuntimeError("Library error")
- _defaction = defaction
def __dealloc__(self):
""" Destroys the filter state and releases any resources.