library: swig: require python 3 when building the swig interface

If Swig builds the library against python 2 and the utils/tests
run using python3, parts of the library are in accesible with
failures like

Traceback (most recent call last):
  File "test-pivot_root_parse.py", line 12, in <module>
    import apparmor.aa as aa
  File "/home/jj/apparmor/apparmor-jjohansen.git/utils/apparmor/aa.py", line 28, in <module>
    import apparmor.logparser
  File "/home/jj/apparmor/apparmor-jjohansen.git/utils/apparmor/logparser.py", line 19, in <module>
    import LibAppArmor
ImportError: No module named LibAppArmor

Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen 2020-04-20 02:09:22 -07:00
parent 9657d9b7e8
commit ff7d1a4eb7

View file

@ -46,7 +46,7 @@ if test "$with_python" = "yes"; then
test -z "$PYTHON" && AC_MSG_ERROR([python is required when enabling python bindings])
sinclude(m4/ac_python_devel.m4)
AC_PYTHON_DEVEL
AM_PATH_PYTHON
AM_PATH_PYTHON([3.0])
fi
AC_MSG_CHECKING([whether perl bindings are enabled])