mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-05 08:45:22 +00:00
libapparmor python bindings: use __init__.py to import from LibAppArmor.py
Fix import errors with swig > 3.0.8 with the libapparmor python bindings. Do this by removing the code to rename the generated LibAppArmor.py, and instead use a stub __init__.py that automatically imports everything from LibAppArmor.py. Also adjust bzrignore to compensate for the autogenerated file name changing. Bug: https://bugzilla.opensuse.org/show_bug.cgi?id=987607 Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: Christian Boltz <apparmor@cboltz.de>
This commit is contained in:
@@ -6,9 +6,8 @@ SUBDIRS = test
|
||||
|
||||
libapparmor_wrap.c: $(srcdir)/../SWIG/libapparmor.i
|
||||
$(SWIG) -python -I$(srcdir)/../../include -module LibAppArmor -o $@ $(srcdir)/../SWIG/libapparmor.i
|
||||
mv LibAppArmor.py __init__.py
|
||||
|
||||
MOSTLYCLEANFILES=libapparmor_wrap.c __init__.py
|
||||
MOSTLYCLEANFILES=libapparmor_wrap.c LibAppArmor.py
|
||||
|
||||
all-local: libapparmor_wrap.c setup.py
|
||||
if test ! -f libapparmor_wrap.c; then cp $(srcdir)/libapparmor_wrap.c . ; fi
|
||||
|
6
libraries/libapparmor/swig/python/__init__.py
Normal file
6
libraries/libapparmor/swig/python/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import sys
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
from LibAppArmor.LibAppArmor import *
|
||||
else:
|
||||
from .LibAppArmor import *
|
Reference in New Issue
Block a user