Subject: make aa-status(8) work without python3-apparmor Submitted upstream: no Author: Steve Beattie Bug: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1480492 If python3-apparmor is not installed, aa-status aborts due to the added import to handle fancier exception handling failing. This patch makes aa-status(8) work even in that case, falling back to normal python exceptions, to keep it's required dependencies as small as possible. Signed-off-by: Steve Beattie --- utils/aa-status | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) Index: b/utils/aa-status =================================================================== --- a/utils/aa-status +++ b/utils/aa-status @@ -13,8 +13,12 @@ import re, os, sys, errno # setup exception handling -from apparmor.fail import enable_aa_exception_handler -enable_aa_exception_handler() +try: + from apparmor.fail import enable_aa_exception_handler + enable_aa_exception_handler() +except ImportError: + # just let normal python exceptions happen (LP: #1480492) + pass def cmd_enabled(): '''Returns error code if AppArmor is not enabled'''