summaryrefslogtreecommitdiff
path: root/src/python/seccomp.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/seccomp.pyx')
-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.