On Wed, Sep 14, 2016 at 02:12:35PM -0500, Tyler Hicks wrote:
> On 09/14/2016 01:52 PM, Christian Boltz wrote:
> > Hello,
> > 
> > renaming LibAppArmor.py to __init__.py breaks the import path
> > calculation in swig (> 3.0.8)-generated python code, leading to an error
> > message saying
> >     No module named '_LibAppArmor'
> > 
> > Therefore this patch drops renaming the file. To stay compatible with the
> >     import LibAppArmor.$function_name
> > syntax, add an __init__.py that does
> >     from LibAppArmor.LibAppArmor import *
> > 
> > References: https://bugzilla.opensuse.org/show_bug.cgi?id=987607
> > 
> > 
> > Also adjust .bzrignore for this change.
> > 
> > 
> > 
> > I propose this patch for trunk and 2.10.
> > I'm undecided about 2.9 - technically it shares this bug, but I'd expect
> > that 2.9 users don't use the latest swig ;-) - opinions?
> 
> Acked-by: Tyler Hicks <[email protected]>
> 
> Please apply to 2.9, as well. IIRC, this is one of the errors I hit when
> I run `make check` on the utils/ dir from Ubuntu 16.04 (with swig
> 3.0.8-0ubuntu3) development machine so it'd be nice if that's fixed in
> all of our stable branches. Thanks for fixing it!

Also, no, it does not fix the make check issue in the utils/ directory:

=== test-pivot_root_parse.py ===
Traceback (most recent call last):
  File "test-pivot_root_parse.py", line 12, in <module>
    import apparmor.aa as aa
  File "/home/steve/bzr/apparmor-master/utils/apparmor/aa.py", line 29, in 
<module>
    import apparmor.logparser
  File "/home/steve/bzr/apparmor-master/utils/apparmor/logparser.py", line 19, 
in <module>
    import LibAppArmor
  File 
"/home/steve/bzr/apparmor-master/libraries/libapparmor/swig/python/build/lib.linux-x86_64-3.5/LibAppArmor/__init__.py",
 line 1, in <module>
    from LibAppArmor.LibAppArmor import *
  File 
"/home/steve/bzr/apparmor-master/libraries/libapparmor/swig/python/build/lib.linux-x86_64-3.5/LibAppArmor/LibAppArmor.py",
 line 28, in <module>
    _LibAppArmor = swig_import_helper()
  File 
"/home/steve/bzr/apparmor-master/libraries/libapparmor/swig/python/build/lib.linux-x86_64-3.5/LibAppArmor/LibAppArmor.py",
 line 20, in swig_import_helper
    import _LibAppArmor
ImportError: No module named _LibAppArmor

-- 
Steve Beattie
<[email protected]>
http://NxNW.org/~steve/

Attachment: signature.asc
Description: PGP signature

-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to